Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.745 diff -u -p -r1.745 user.module --- modules/user/user.module 11 Jan 2007 08:52:45 -0000 1.745 +++ modules/user/user.module 25 Jan 2007 07:56:52 -0000 @@ -1782,8 +1782,11 @@ function user_admin_perm($rid = NULL) { } // Compile role 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 (is_numeric($rid)) { @@ -1811,7 +1814,7 @@ function user_admin_perm($rid = NULL) { $form['permission'][$perm] = array('#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; } }