Beispiel #1
0
 public static final function removeRightsOnSections(array $sections, array $rights)
 {
     $tasks = CWebDavIblock::GetTasks();
     $reformatRights = array();
     $i = 0;
     foreach ($rights as $letter => $groupCodes) {
         if (!is_array($groupCodes)) {
             $groupCodes = array($groupCodes);
         }
         foreach ($groupCodes as $groupCode) {
             $reformatRights['n' . $i] = array('GROUP_CODE' => $groupCode, 'TASK_ID' => $tasks[$letter]);
             $i++;
         }
         unset($groupCode);
     }
     unset($right);
     foreach ($sections as $section) {
         $sectionId = (int) $section['ID'];
         if ($sectionId <= 0) {
             continue;
         }
         if (CIBlock::GetArrayByID($section['IBLOCK_ID'], "RIGHTS_MODE") === "E") {
             $rightObject = CWebDavIblock::_get_ib_rights_object('SECTION', $sectionId, $section['IBLOCK_ID']);
             $rightObject->SetRights(CWebDavTools::removeRights($rightObject, $reformatRights, $tasks));
         }
     }
     unset($section);
 }