Allow renaming of roles
David Lesieur - August 26, 2007 - 00:02
| Project: | Role Delegation |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Renaming a role currently causes the loss of role_delegation permissions for that role.

#1
Does this mean that Role Delegation isn't using role IDs?
#2
The problem is that the permission names created by Role Delegation are derived from role names, and Drupal uses permissions names as IDs. Using role IDs is not an option here, as that would make the Access control settings unusable.
Something we could probably do is updating the permissions when the role editing form ("user_admin_role") is submitted.
#3
The attached patch does this. When role X is renamed or deleted, we rename or delete (resp.) the "assign X role" permission in every entry in the permission table. Please test.