Index: trunk/kernel/include/category.php =================================================================== diff -u -N -r7635 -r7867 --- trunk/kernel/include/category.php (.../category.php) (revision 7635) +++ trunk/kernel/include/category.php (.../category.php) (revision 7867) @@ -631,47 +631,28 @@ function SetViewPerms($PermName,$acl,$allgroups) { - global $objPermCache; + global $objPermCache; - $dacl = array(); - if(!is_array($allgroups)) - { - global $objGroups; - $allgroups = $objGroups->GetAllGroupList(); - } + if (!is_array($allgroups)) { + global $objGroups; + $allgroups = $objGroups->GetAllGroupList(); + } - for($i=0;$iPermissions->GetPermId($PermName); - $pc = $objPermCache->GetPerm($this->Get("CategoryId"),$PermId); - if(is_object($pc)) - { - $pc->Set("ACL",$aval); - $pc->Set("DACL",$dval); - $pc->Update(); - } - else - $objPermCache->AddPermCache($this->Get("CategoryId"),$PermId,$aval,$dval); + $aval = implode(",",$acl); - //$this->Update(); + if (strlen($aval)==0) { + $aval = implode(",",$allgroups); + } + $PermId = $this->Permissions->GetPermId($PermName); + $pc = $objPermCache->GetPerm($this->Get("CategoryId"),$PermId); + if (is_object($pc)) { + $pc->Set("ACL",$aval); + $pc->Update(); + } + else { + $objPermCache->AddPermCache($this->Get("CategoryId"),$PermId,$aval); + } + //$this->Update(); } function GetACL($PermName) @@ -691,8 +672,8 @@ function UpdateACL() { - $q = 'INSERT INTO '.TABLE_PREFIX.'PermCache (CategoryId, PermId, ACL, DACL) - SELECT '.$this->UniqueId().', PermId, ACL, DACL + $q = 'INSERT INTO '.TABLE_PREFIX.'PermCache (CategoryId, PermId, ACL) + SELECT '.$this->UniqueId().', PermId, ACL FROM '.TABLE_PREFIX.'PermCache WHERE CategoryId = '.$this->Get('ParentId'); $this->Conn->Query($q);