diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-01-29 19:07:53 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-01-29 19:07:53 +0000 |
commit | 00f377cdcbf5aaf84651c69185c260091bf12ca7 (patch) | |
tree | 62aecc41e5b99b8f016dbed3fe46564e69459363 | |
parent | 6912ffbccb88f341a36b172191f33e993a63f8de (diff) | |
download | brdo-00f377cdcbf5aaf84651c69185c260091bf12ca7.tar.gz brdo-00f377cdcbf5aaf84651c69185c260091bf12ca7.tar.bz2 |
- Patch #81891 by alusiani and dww: fixed problem with matching permissions.
-rw-r--r-- | modules/user/user.module | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 4f3cafefd..7e52861e9 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1867,8 +1867,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)) { @@ -1896,7 +1899,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; } } |