Adding default language permission

toemaz - February 20, 2009 - 12:22
Project:Translation Access
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Excellent module which comes in very handy for a big multi lingual website. I do have however, one extra feature request. In i18n_access_load_permissions() the permissions per user are loaded. I would like to add default permissions for languages which can be selected by the administrator.

Use case: A website with English as default language has a book node type which can be translated to other languages. Authenticated users can edit all en book nodes, but for the other languages one needs to have the i18n_access permissions.

Implementation:
- implementing hook_perm for adding a permission to receive edit access to nodes in the choosen languages (see next point)
- adding an admin setting form to /admin/settings/... or admin/user/... which saves an array of the default languages for the choosen role (see previous point)
- enhancing i18n_access_load_permissions() where the user with the right role gets access to the right language.

I'm willing to make this patch. Would you consider to commit this? Do you think this is useful for your use case?

#1

toemaz - February 20, 2009 - 15:08
Status:active» needs review

I went ahead, made a patch and I am using it now on a production website for serious testing.
Looking forward for your feedback. Thx.

AttachmentSize
i18n_access_default_language.patch 1.88 KB

#2

Roger López - February 20, 2009 - 22:20

Thanks for the patch. I'm gonna try to paraphrase what its supposed to do:

- The site admin can set certain languages to be default.
- A new permission is created to "access default languages"
- Users with this permission always have access to the "default access languages".

Seems like a reasonable patch. My biggest concern is the terminology for "default access languages".

I also have concerns for how many different places need to be touched to set this up.
1. Permissions page
2. Language access page
3. User account page

I'm gonna play around with this patch to get a feel for it. Any suggestions welcome.

#3

toemaz - February 23, 2009 - 19:49

Thanks for the feedback Roger and your paraphrasing is correct.

I have not found a better name so far. Not being a native English speaker, it's hard to find a term for it which really covers what it means. Perhaps something with 'standard' instead of 'default' and 'assigned' instead of 'access'.

Regarding the different places: with some documentation, this shouldn't be a big issue I guess. Also, the module works out of the box. This patch just adds something extra for a specific use case.

I run this patch on http://musescore.org which is quite a large multilingual setup and with success so far. So thanks a lot for your module.

 
 

Drupal is a registered trademark of Dries Buytaert.