- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/Service/UserPermissions.php
- Класс: Bitrix\Crm\Service\UserPermissions
- Вызов: UserPermissions::checkExportPermissions
public function checkExportPermissions(int $entityTypeId, int $id = 0, ?int $categoryId = null): bool
{
$canExportType = is_null($categoryId)
? $this->canExportType($entityTypeId)
: $this->canExportTypeInCategory($entityTypeId, $categoryId)
;
if (!$canExportType)
{
return false;
}
if ($id === 0)
{
return $canExportType;
}
if ($id > 0 && $categoryId === null)
{
$categoryId = $this->getItemCategoryIdOrDefault($entityTypeId, $id);
}
$entityName = static::getPermissionEntityType($entityTypeId, $categoryId);
$attributes = Manager::resolveController($entityName)->getPermissionAttributes($entityName, [$id]);
$entityAttributes = $attributes[$id] ?? [];
return $this->getCrmPermissions()->CheckEnityAccess($entityName, static::OPERATION_EXPORT, $entityAttributes);
}