Index: modules/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/Attic/user.module,v retrieving revision 1.612.2.27 diff -u -p -r1.612.2.27 user.module --- modules/user.module 10 Jan 2007 09:10:09 -0000 1.612.2.27 +++ modules/user.module 25 Jan 2007 07:57:17 -0000 @@ -1764,9 +1764,11 @@ function user_admin_perm($str_rids = NUL } // Compile role array: - $roles = array(); + // Add a comma at the end so when searching for a permission, we can + // always search for "$perm," to make sure we do not confuse + // permissions that are substrings of each other. while ($role = db_fetch_object($result)) { - $role_permissions[$role->rid] = $role->perm; + $role_permissions[$role->rid] = $role->perm .','; } if($rids) { @@ -1791,7 +1793,7 @@ function user_admin_perm($str_rids = NUL $form['permission'][$perm] = array('#type' => 'markup', '#value' => t($perm)); foreach ($role_names as $rid => $name) { // Builds arrays for checked boxes for each role - if (strstr($role_permissions[$rid], $perm)) { + if (strpos($role_permissions[$rid], $perm .',') !== FALSE) { $status[$rid][] = $perm; } }