• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/Access/ActionDictionary.php
  • Класс: BitrixCatalogAccessActionDictionary
  • Вызов: ActionDictionary::getActionRuleName
static function getActionRuleName(string $value): ?string
{
	$constants = self::getActionNames();
	if (!array_key_exists($value, $constants))
	{
		return null;
	}

	$storeDocumentActions = [
		self::ACTION_STORE_DOCUMENT_MODIFY,
		self::ACTION_STORE_DOCUMENT_CANCEL,
		self::ACTION_STORE_DOCUMENT_DELETE,
		self::ACTION_STORE_DOCUMENT_CONDUCT,
		self::ACTION_STORE_DOCUMENT_VIEW,
	];
	if (in_array($value, $storeDocumentActions, true))
	{
		$value = self::ACTION_STORE_DOCUMENT_PERFORM;
	}

	$storeActions = [
		self::ACTION_STORE_VIEW,
		self::ACTION_STORE_PRODUCT_RESERVE,
	];
	if (in_array($value, $storeActions, true))
	{
		$value = self::ACTION_STORE_VIEW;
	}

	if ($value === self::ACTION_PRODUCT_DISCOUNT_SET)
	{
		$value = self::ACTION_PRICE_ENTITY_EDIT;
	}

	return str_replace(self::PREFIX, '', $constants[$value]);
}