當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CIBlockRights::setRights方法代碼示例

本文整理匯總了PHP中CIBlockRights::setRights方法的典型用法代碼示例。如果您正苦於以下問題:PHP CIBlockRights::setRights方法的具體用法?PHP CIBlockRights::setRights怎麽用?PHP CIBlockRights::setRights使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CIBlockRights的用法示例。


在下文中一共展示了CIBlockRights::setRights方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processActionSetDelegateResponsible

 protected function processActionSetDelegateResponsible()
 {
     $this->checkRequiredPostParams(array('iblockId'));
     if (!Loader::includeModule('iblock')) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_CONNECTION_MODULE_IBLOCK'))));
     }
     $this->iblockId = intval($this->request->getPost('iblockId'));
     $this->iblockTypeId = COption::GetOptionString("lists", "livefeed_iblock_type_id");
     $this->checkPermission();
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
     $selectUsers = $this->request->getPost('selectUsers');
     $rightObject = new CIBlockRights($this->iblockId);
     $rights = $rightObject->getRights();
     $rightsList = $rightObject->getRightsList(false);
     $idRight = array_search('iblock_full', $rightsList);
     foreach ($rights as $keyRight => $right) {
         $res = strpos($right['GROUP_CODE'], 'U');
         if ($res === 0) {
             $arraySearch = array_search($right['GROUP_CODE'], $selectUsers);
             if ($right['TASK_ID'] == $idRight) {
                 if (!empty($selectUsers)) {
                     if ($arraySearch || $arraySearch == 0) {
                         unset($rights[$keyRight]);
                     }
                 } else {
                     unset($rights[$keyRight]);
                 }
             } else {
                 if (!empty($selectUsers)) {
                     if ($arraySearch || $arraySearch == 0) {
                         unset($rights[$keyRight]);
                     }
                 }
             }
         }
     }
     if (!empty($selectUsers)) {
         foreach ($selectUsers as $keySelect => $idUser) {
             $rights['n' . $keySelect] = array('GROUP_CODE' => $idUser, 'TASK_ID' => $idRight);
         }
     }
     $rightObject->setRights($rights);
     $this->sendJsonSuccessResponse(array('message' => Loc::getMessage('LISTS_SEAC_MESSAGE_DELEGATE_RESPONSIBLE')));
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:46,代碼來源:ajax.php

示例2: createIBlockRights

 /**
  * @param int $iblockId This variable is the id iblock.
  */
 private static function createIBlockRights($iblockId)
 {
     $rightObject = new \CIBlockRights($iblockId);
     $rights = $rightObject->getRights();
     $rightsList = $rightObject->getRightsList(false);
     $rightId = array_search('iblock_full', $rightsList);
     $rights['n0'] = array('GROUP_CODE' => "G1", 'TASK_ID' => $rightId);
     $rights['n1'] = array('GROUP_CODE' => "U1", 'TASK_ID' => $rightId);
     $rightId = array_search('iblock_element_add', $rightsList);
     $rights['n2'] = array('GROUP_CODE' => "G2", 'TASK_ID' => $rightId);
     $rightObject->setRights($rights);
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:15,代碼來源:importer.php


注:本文中的CIBlockRights::setRights方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。