• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/engine/access.php
  • Класс: BitrixRestEngineAccess
  • Вызов: Access::isAvailable
static function isAvailable($app = '') : bool
{
	if (!static::isActiveRules())
	{
		return true;
	}

	if (!array_key_exists($app, static::$availableApp))
	{
		static::$availableApp[$app] = false;
		if (Client::isSubscriptionAvailable())
		{
			static::$availableApp[$app] = true;
		}
		elseif (static::isFeatureEnabled())
		{
			static::$availableApp[$app] = true;
		}
		elseif ($app !== '')
		{
			if (in_array($app, Immune::getList(), true))
			{
				static::$availableApp[$app] = true;
			}
			else
			{
				$appInfo = AppTable::getByClientId($app);
				if ($appInfo['CODE'] && in_array($appInfo['CODE'], Immune::getList(), true))
				{
					static::$availableApp[$app] = true;
				}
			}
		}
	}

	return static::$availableApp[$app];
}