Index: branches/5.2.x/core/units/helpers/permissions_helper.php =================================================================== diff -u -N -r13840 -r14092 --- branches/5.2.x/core/units/helpers/permissions_helper.php (.../permissions_helper.php) (revision 13840) +++ branches/5.2.x/core/units/helpers/permissions_helper.php (.../permissions_helper.php) (revision 14092) @@ -1,6 +1,6 @@ Application->GetVar('m_cat_id'); + } + if ($type == 1) { // "system" permission are always checked per "Home" category (ID = 0) $cat_id = 0; } - - if (!isset($cat_id)) { - $cat_id = $this->Application->GetVar('m_cat_id'); + elseif ("$cat_id" === "0") { + $cat_id = $this->Application->getBaseCategory(); } // perm cache is build only based on records in db, that's why if permission is not explicitly denied, then @@ -612,7 +615,7 @@ $cat_hierarchy = $this->Conn->GetOne($sql); if ($cat_hierarchy === false) { // category was deleted, but refrence to it stays in other tables -> data integrity is broken - $cat_hierarchy = '|' . $this->Application->findModule('Name', 'Core', 'RootCat') . '|'; + $cat_hierarchy = '|' . $this->Application->getBaseCategory() . '|'; } }