Download & Extend

Add Ability to Define Permission on Role level vs User level?

Project:Translation Access
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:irakli
Status:active

Issue Summary

Editing permissions for individual users is simply not feasible for a website with reasonably large number of editors/users. A much cleaner implementation would be to have the options that you have on user edit, be placed in role edit (and subsequent changes when checking permissions etc.).

Don't get me wrong: user-level settings may still be useful, but less granular, role-level ones are also quite necessary.

I don't think adding this feature is worth creating new module and I am not sure if you have availability to add this feature. If you don't and if you can grant me CVS access, I will try to add that. The change is probably more involved than what a simple patch could handle.

cheers

irakli

Comments

#1

Duplicate issue at #481354

#2

Status:active» needs review

Add a hook_perm()

<?php
/**
* Implementation of hook_perm()
*/
function i18n_access_perm() {
  return array(
'exclude access check');
}
?>

And modify the i18n_access_node_access() function by adding

<?php
 
if (user_access('exclude access check')) {
    return
TRUE;
  }
?>

That's it. Perhaps the permission can be named better.

#3

Status:needs review» fixed

A preliminary implemention of this feature request has been committed. See #378042: Adding default language permission for more details. Feel free to reopen this issue if you wish to further expand it and perhaps add possibility to create more permissions. For now, there is only one permission available.

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#5

Status:closed (fixed)» active

Hi there,

I am reopening this issue because a role-based approach could be compatible with the user-based one.

* If no permissions are set, then the user-based approche is fine.
* If you create roles that need access only to one or several languages, those permissions are added to the user-based permissions.

I find the default languages select does not solve several use cases and, as you stated in the original issue, you need to configure it in several places.

Having one permission per active language would achive the same functionality without much hassel (given that not many sites have more than 3 o 4 languages active), and it would only be set in the permissions pages, and it would allow to different language combinations by role, which the default languages options does not.

I am afraid I cannot produce a patch, but still wanted to make the point. Thanks a lot

#6

Valid point but your implementation proposal becomes a nightmare when more than 5 languages are enabled. And yes, there are sites who have this. I manage one with 43 languages enabled currently ;) So another implementation proposal?

#7

Hi toemaz,

43 languages, are a lot. Full respect.

There could be two variations of the approach:

At admin/settings/language/access offer several options:
* Use only one permission setting for the selected languages above
* Use one permission setting per active language and ignore the selected languages above (not recommended for sites with many active languages)
* Use both selected languges and per languager permission settings.

Or a more twisted approach but maybe interesting: allow the creation of several "groups of languages" and add a permission setting for each group. I think this would only make it a bit more complicated, but could be useful for users with many languages.

By the way, I think it would be more accurate to call the permission "create/update nodes in selected languages", because "access selected languages" might confuse some people.

nobody click here