Posted by svihel on February 9, 2010 at 1:16pm
3 followers
Jump to:
| Project: | Administer Users by Role |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | smokris |
| Status: | closed (fixed) |
Issue Summary
When I had role name something like "User [with editation]" and tried to add some other role permission to edit or delete this role (edit users with role User [with editation]) system returned an error after submitting the form. After I changed the role name to standard brackets () it started working.
Probably something with function
<?php
function administerusersbyrole_perm() {
$roles = db_query('SELECT name FROM {role} WHERE rid > 2 ORDER BY name');
$perms = array();
$perms[] = 'create users';
while ($role=db_fetch_array($roles)) {
$perms[] = 'edit users with role '. $role['name'];
$perms[] = 'delete users with role '. $role['name'];
}
return $perms;
}
?>Character escaping would probably solve this. Didnt tested that though.
Comments
#1
I don't think there exists a way to escape characters for use in permissions strings.
I've added a workaround, which removes any non-alphanumeric characters from the permissions strings generated by Administer Users by Role.
Committed to 6.x-1.x-dev as http://drupalcode.org/project/administerusersbyrole.git/commit/44cd055.
#2
Automatically closed -- issue fixed for 2 weeks with no activity.