Problem/Motivation
Found on the 'Create a new user' page.
When a user is enabled to delegate a user role, the available roles are shown as checkboxes. This allows users to apply multiple levels of permissions to a single user, rather than restricting the user to a single role.
While this may sometimes be desirable, there is no option to disallow users with delegation permissions from selecting any number of account types for a single user
Proposed resolution
I propose adding an option under the Permissions page that allows/disallows a nominated user from applying multiple User roles to a user. If it is enabled, the nominated user can apply multiple permissions via checkboxes. If disabled, they will instead see the roles as radio checkboxes. This will allow the best of both worlds.
Remaining tasks
Permissions of the Role Delegation module updated, testing needed, updated webpage needed detailing changes (if implemented)
User interface changes
New checkbox option under Permissions page for 'Allow this user to assign multiple roles to a single user'.
If checked, the user will see the current setup when assigning a role to a user. If no checked, they will instead see radio checkboxes, allowing only one role to be assigned.
API changes
No idea
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2405595-6.patch | 1.48 KB | jeroent |
Comments
Comment #1
timfletcher commentedComment #2
roderikThis would create a real issue on existing sites with editing existing users who have multiple roles assigned. At the least, warnings should be displayed before setting this option.
It's not obvious that restricting the user to a single role is a regular use case; it seems to go against the philosophy of how Drupal's role/permission system is set up.
Your issue description (by not addressing this) apparently assumes it is a regular use case. But maybe a justification/explanation of where/why you need this restriction, is in order?
Comment #3
mrpauldriver commentedI too have a need for such functionality and believe it is a perfectly normal used case to want to limit users to having only one role.
Role Delegation module is highly useful because without it you get people making themselves administrators. Another problem is that those with role delegating authority often misunderstand the consequences of giving another user the wrong role - just selecting all that they think 'might' apply. I find this happening 'all the time'.
There is a Single User Role module but it has an a number of issues with reference to compatibility with Role Delegation module.
Not sure if you are aware of each other so will also cross post over there.
Comment #4
mrpauldriver commentedBumping up to D8 and hoping that if this gets off the ground it also get back ported to D7 :-)
Comment #5
Jonah Fenn commentedI would really like to see this functionality in place. When using the Group module in Drupal 8 (or OG in Drupal 7) having users who have multiple sitewide roles applied to them in addition to their group level roles is a real nightmare.
Let me know how I can help out.
Comment #6
jeroentComment #7
jeroentIMO this is something that should be fixed in Single user role.
I provided a patch there: #2841912: Does Not Work With Role Delegation which makes sure the module works when role_delegation is also enabled. I also made some changes to this module to make sure the roles are assigned correctly.