Compatible::getScopeRegexForEntity

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Compatible
  4. getScopeRegexForEntity
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/security/controller/querybuilder/compatible.php
  • Класс: Bitrix\Crm\Security\Controller\QueryBuilder\Compatible
  • Вызов: Compatible::getScopeRegexForEntity
protected function getScopeRegexForEntity(string $permissionEntityType): string
{
	$scopeRegex = '';
	$entityName = \Bitrix\Crm\Service\UserPermissions::getEntityNameByPermissionEntityType($permissionEntityType);
	$factory = \Bitrix\Crm\Service\Container::getInstance()->getFactory(\CCrmOwnerType::ResolveID($entityName));
	if ($factory && $factory->isStagesSupported())
	{
		$stageFieldName = $factory->getEntityFieldNameByMap(\Bitrix\Crm\Item::FIELD_NAME_STAGE_ID);
		if ($entityName === \CCrmOwnerType::QuoteName)
		{
			$stageFieldName = 'QUOTE_ID'; // strange but true
		}
		$scopeRegex = '/^' . $stageFieldName . '[0-9A-Z\:\_\-]+$/i';
	}

	return $scopeRegex;
}

Добавить комментарий