• Модуль: rpa
  • Путь к файлу: ~/bitrix/modules/rpa/lib/integration/bizproc/document/item.php
  • Класс: BitrixRpaIntegrationBizprocDocumentItem
  • Вызов: Item::canUserOperateDocumentType
static function canUserOperateDocumentType($operation, $userId, $documentType, $arParameters = []): bool
{
	$userId = (int) $userId;
	$user = new CBPWorkflowTemplateUser($userId);
	$typeId = (int) str_replace('T', '', $documentType);

	if ($user->isAdmin())
	{
		return true; //Admin is the Lord of the Automation
	}

	if ($operation === CBPCanUserOperateOperation::CreateAutomation)
	{
		return Driver::getInstance()->getUserPermissions()->canModifyType($typeId);
	}

	return false;
}