By krazykanuk on
I have created my site with drupal 6.20, and created a few roles and gave each role the appropriate permissions. The problem I am having is when I goto Administration -> User Management -> User and go to update a users role that already has a role it adds the second role to the user. Is there a way that when a user is given a new role the old role is removed, or is this the desired drupal behavior and this is something I would need to create a module to accomplish?
Comments
_
This is the correct behavior-- if you want to remove a role then you need to actually remove it.
OK, so for drupal to only
OK, so for drupal to only have only one user role I would need to remove the desired role then add the new role for the user, or create a module that would remove old roles when a new one was added (or check that a module doesn't already exist that already does this).
_
you could do it with the rules module, but that might be overkill for only this. So yep-- you need to either do it manually or create a little custom module to do it.
Unless you have a complex web
Unless you have a complex web of permissions, I find it is best to only enable the features that 'higher level' roles have access to. In most instances this works. For example assume I have 2 role. Employee and Manager. Manager can do everything an Employee can, but he can also administer users.
So, set up the Employee role to do everything that all users at the employee level and higher can do.
Then, your manager role has only 1 box checked - the "Administer Users" box.
All users belong to the "Employee" role and get all of it's permissions. Users with the "Manager" role get 1 additional permission.
In most instances this also makes managing your site's permissions easier too. It doesn't work in all scenarios but it has been my experience that it works well most of the time.
I don't think this will work
I don't think this will work too well in my situation. The roles I am using are for something else not even related to drupal I just use drupal as the mechanism to register users and change the roles. I am setting up a game server for my girlfriends son and I use drupal for registration and to create the information in the game server database and add the login information in there. All roles are for the game. In the game there is a number of roles (GameAdmin, GameMaster, GameAssistant, GameHelper, Player) I use the roles to switch roles for the game and use the GameAdmin role to also administer the drupal website. From what I know of the game and who will be administering the site I best to make it when one role is added the role they had removed for it won't be done and then will be asked to fix why certain roles are permitted to do stuff they shouldn't on the website.