当前位置: 首页>>代码示例>>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;未经允许,请勿转载。