• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/Entity/RestrictionManager.php
  • Класс: Bitrix\CrmMobile\Entity\RestrictionManager
  • Вызов: RestrictionManager::getEntityRestrictions
static function getEntityRestrictions(int $entityTypeId): Bitrix24AccessRestriction
{
	if ($entityTypeId === \CCrmOwnerType::Lead)
	{
		return \Bitrix\Crm\Restriction\RestrictionManager::getLeadsRestriction();
	}

	if ($entityTypeId === \CCrmOwnerType::Quote)
	{
		return \Bitrix\Crm\Restriction\RestrictionManager::getQuotesRestriction();
	}

	if ($entityTypeId === \CCrmOwnerType::Invoice || $entityTypeId === \CCrmOwnerType::SmartInvoice)
	{
		return \Bitrix\Crm\Restriction\RestrictionManager::getInvoicesRestriction();
	}

	$dynamicTypesRestriction = \Bitrix\Crm\Restriction\RestrictionManager::getDynamicTypesLimitRestriction();
	if ($dynamicTypesRestriction->isCreateItemRestricted($entityTypeId))
	{
		return new Bitrix24AccessRestriction($dynamicTypesRestriction::FEATURE_NAME, false);
	}

	return new Bitrix24AccessRestriction('', true);
}