...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_authorization_helper.php
- Класс: \CCrmAuthorizationHelper
- Вызов: CCrmAuthorizationHelper::CheckDeletePermission
static function CheckDeletePermission($entityTypeName, $entityID, $userPermissions = null, $entityAttrs = null) { $entityTypeName = strval($entityTypeName); $entityID = intval($entityID); if(!$userPermissions) { $userPermissions = self::GetUserPermissions(); } if (\Bitrix\Crm\Service\Container::getInstance()->getUserPermissions($userPermissions->GetUserID())->isAdmin()) { return true; } if($entityID <= 0) { return !$userPermissions->HavePerm($entityTypeName, BX_CRM_PERM_NONE, 'DELETE'); } if(!is_array($entityAttrs)) { $entityAttrs = $userPermissions->GetEntityAttr($entityTypeName, $entityID); } return !$userPermissions->HavePerm($entityTypeName, BX_CRM_PERM_NONE, 'DELETE') && $userPermissions->CheckEnityAccess($entityTypeName, 'DELETE', isset($entityAttrs[$entityID]) ? $entityAttrs[$entityID] : array()); }