AccessController::getRuleName

  1. Bitrix24 API (v. 23.675.0)
  2. sender
  3. AccessController
  4. getRuleName
  • Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/access/accesscontroller.php
  • Класс: Bitrix\Sender\Access\AccessController
  • Вызов: AccessController::getRuleName
protected function getRuleName(string $actionCode): ?string
{
	$actionName = ActionDictionary::getActionName($actionCode);
	if (!$actionName)
	{
		return null;
	}

	$action = explode('_', $actionName);
	$action = array_map(
		function($el)
		{
			return ucfirst(mb_strtolower($el));
		}, $action
	);

	$ruleClass = $this->getRuleNamespace() .implode($action).self::RULE_SUFFIX;


	if(class_exists($ruleClass))
	{
		return $ruleClass;
	}

	return $this->getRuleNamespace().self::BASE_RULE.self::RULE_SUFFIX;
}

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