• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/classes/general/rest_util.php
  • Класс: CRestUtil
  • Вызов: CRestUtil::checkAppAccess
static function checkAppAccess($appId, $appInfo = null)
{
	global $USER;

	$hasAccess = CRestUtil::isAdmin();
	if(!$hasAccess)
	{
		if($appInfo === null)
		{
			$appInfo = BitrixRestAppTable::getByClientId($appId);
		}

		if($appInfo)
		{
			if(!empty($appInfo["ACCESS"]))
			{
				$rights = explode(",", $appInfo["ACCESS"]);
				$hasAccess = $USER->CanAccess($rights);
			}
			else
			{
				$hasAccess = true;
			}
		}
	}

	return $hasAccess;
}