• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/restriction/restrictionmanager.php
  • Класс: Bitrix\Crm\Restriction\RestrictionManager
  • Вызов: RestrictionManager::getCommonOperationRestriction
static function getCommonOperationRestriction(int $entityTypeId): Bitrix24AccessRestriction
{
	$diskQuotaRestriction = static::getDiskQuotaRestriction();
	if (!$diskQuotaRestriction->hasPermission())
	{
		return $diskQuotaRestriction;
	}

	if ($entityTypeId === \CCrmOwnerType::Lead)
	{
		return static::getLeadsRestriction();
	}
	if ($entityTypeId === \CCrmOwnerType::Quote)
	{
		return static::getQuotesRestriction();
	}
	if ($entityTypeId === \CCrmOwnerType::Invoice || $entityTypeId === \CCrmOwnerType::SmartInvoice)
	{
		return static::getInvoicesRestriction();
	}

	return new Bitrix24AccessRestriction('', true);
}