--- user.module.5.3.orig 2007-10-18 15:55:18.000000000 -0700 +++ user.module 2007-10-18 16:00:48.000000000 -0700 @@ -349,7 +349,7 @@ function user_password($length = 10) { * way, we guarantee consistent behavior, and ensure that the superuser * can perform all actions. */ -function user_access($string, $account = NULL) { +function user_access($string, $account = NULL, $reset = FALSE) { global $user; static $perm = array(); @@ -364,7 +364,7 @@ function user_access($string, $account = // To reduce the number of SQL queries, we cache the user's permissions // in a static variable. - if (!isset($perm[$account->uid])) { + if (!isset($perm[$account->uid]) || $reset) { $rids = array_keys($account->roles); $placeholders = implode(',', array_fill(0, count($rids), '%d')); $result = db_query("SELECT DISTINCT(p.perm) FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN ($placeholders)", $rids);