This is my current situation: I've a website with four roles: "manager", "contributor" and "editor". Those roles cannot be added together to an user. An user can be a "manager" OR "contributor" OR "editor".
Currently "manager" users can create new users. I've used Administer Users by Role module so "manager" users can add/delete other users except the administration account. I've also used Role delegation module which allows "manager" users to assign the role to users.
When a "manager" add/edit an user, the role selection form displays all the selectable roles ("manager", "contributor" and "editor") with checkboxes.
I'd like to change checkboxes to an "option button" so only one role can be selected.
Someone has suggestions or hints about this issue? Should I customize Role delegation module or does it exists a simple way?
Thanks :-)
Comments
Another idea I've had (but
Another idea I've had (but still unapplicable) is to modify the auto assign role in order to allow managers to create user account from specific path: role by path
http://drupal.org/node/673760
--
by FiNeX
FiNeX.org
Siti Web Vicenza
I'm also trying with strange
I'm also trying with strange rules and pageroute combinations, but it looks that I'm not following the right path... :-(
--
by FiNeX
FiNeX.org
Siti Web Vicenza
Role delegation module
Check out the Role Delegation module. You choose which roles can assign which other roles to users.
Another option is to use the Rules module but that may be a bit overkill.
As I've wrote in the initial
As I've wrote in the initial message, I'm already using it, but it cannot force a single role from the selectable roles: more roles can be selected.
What I need is to give to the privileged user the ability to select only one role from the list of allowed selectable roles.
--
by FiNeX
FiNeX.org
Siti Web Vicenza
Ah, sorry I missed that
Ah, sorry I missed that point.
Two things that come to mind initially are...
1) Override that form and change the checkboxes to radio buttons. That may be the best approach, but I'm not sure exactly how to do that.
2) Use the Rules module to trigger off of that form submission. In the condition of that rule you can write a little PHP to check if more than one role is selected. If so then you throw a form validation error and provide a message to the user.
Same problem..
I was wondering if there any updates on this case?
Include the following in the
Include the following in the module:
Register form don't convert options
In my case, this solution doesn't work with Role Delegation module... Do you know another solution?
Thanks!!
Not sure if you ever came right
Not sure if you ever came right with this, but I thought I'll perhaps put what I did for Role Delegation:
I have the same situation
I have the same situation where I have tree roles and need to asign one role per user.
Based in the timofey code I created a sandbox with a little module that simply do this feature.
The link to the sandbox for everyone who needs the same feature.
https://drupal.org/sandbox/wolmi/2022403
Single Role Module is all you need :-)
Hey FiNeX,
I've created this sandbox project with same requirement. Please test it, surely this will help you out.
git clone --branch master http://git.drupal.org/sandbox/RishiKulshreshtha/2235115.git single_roleCheers!
Single User Role for drupal 7
If anyone looking for module to limit user roles to one role per user then there is a module Single User Role for drupal 7. This module is also compatible with role delegation module. Module also provides configuration option to whether you want radio or select list for role field.