Index: branches/5.1.x/core/units/helpers/permissions_helper.php =================================================================== diff -u -r13086 -r13168 --- branches/5.1.x/core/units/helpers/permissions_helper.php (.../permissions_helper.php) (revision 13086) +++ branches/5.1.x/core/units/helpers/permissions_helper.php (.../permissions_helper.php) (revision 13168) @@ -1,6 +1,6 @@ Application->GetVar('m_cat_id'); } - $cache_key = $name.'|'.$type.'|'.$cat_id; - $perm_value = $this->Application->getCache('permissions', $cache_key); - if ($perm_value !== false) { - return $perm_value; - } - // perm cache is build only based on records in db, that's why if permission is not explicitly denied, then // that (perm cache creator) code thinks that it is allowed & adds corresponding record and code below will // return incorrect results @@ -557,6 +551,13 @@ array_push($groups, $this->Application->ConfigValue('User_LoggedInGroup') ); } + $cache_key = $name . '|' . $type . '|' . $cat_id . '|' . implode(',', $groups); + $perm_value = $this->Application->getCache('permissions[%' . ($type == 1 ? 'G' : 'C') . 'PermSerial%]:' . $cache_key); + + if ($perm_value !== false) { + return $perm_value; + } + if (preg_match('/(.*)\.VIEW$/', $name) && ($type == 0)) { // cached view permission of category: begin if (strpos($cat_id, '|') !== false) { @@ -580,7 +581,7 @@ $sql .= ' AND ('.implode(' OR ', $view_filters).')'; $perm_value = $this->Conn->GetOne($sql) ? 1 : 0; - $this->Application->setCache('permissions', $cache_key, $perm_value); + $this->Application->setCache('permissions[%CPermSerial%]:' . $cache_key, $perm_value); return $perm_value; // cached view permission of category: end } @@ -621,7 +622,8 @@ } } - $this->Application->setCache('permissions', $cache_key, $perm_value); + $this->Application->setCache('permissions[%' . ($type == 1 ? 'G' : 'C') . 'PermSerial%]:' . $cache_key, $perm_value); + return $perm_value; }