本文整理汇总了PHP中CAccess::getNames方法的典型用法代码示例。如果您正苦于以下问题:PHP CAccess::getNames方法的具体用法?PHP CAccess::getNames怎么用?PHP CAccess::getNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAccess
的用法示例。
在下文中一共展示了CAccess::getNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processActionShowRightsDetail
protected function processActionShowRightsDetail()
{
$this->checkRequiredPostParams(array('objectId'));
if ($this->errorCollection->hasErrors()) {
$this->sendJsonErrorResponse();
}
/** @var \Bitrix\Disk\File|\Bitrix\Disk\Folder $object */
$object = BaseObject::loadById((int) $this->request->getPost('objectId'), array('STORAGE'));
if (!$object) {
$this->errorCollection->add(array(new Error(Loc::getMessage('DISK_FOLDER_LIST_ERROR_COULD_NOT_FIND_OBJECT'), self::ERROR_COULD_NOT_FIND_OBJECT)));
$this->sendJsonErrorResponse();
}
$rightsManager = Driver::getInstance()->getRightsManager();
$securityContext = $object->getStorage()->getCurrentUserSecurityContext();
if (!$object->canChangeRights($securityContext)) {
$this->sendJsonAccessDeniedResponse();
}
$rightsByAccessCode = array();
foreach ($rightsManager->getAllListNormalizeRights($object->getRealObject()) as $rightOnObject) {
if (empty($rightOnObject['NEGATIVE'])) {
$rightOnObject['TASK'] = $rightsManager->getTaskById($rightOnObject['TASK_ID']);
$rightsByAccessCode[$rightOnObject['ACCESS_CODE']][] = $rightOnObject;
}
}
$access = new CAccess();
$names = $access->getNames(array_keys($rightsByAccessCode));
$this->sendJsonSuccessResponse(array('rights' => $rightsByAccessCode, 'accessCodeNames' => $names));
}