• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/sessionauth/auth.php
  • Класс: BitrixRestSessionAuthAuth
  • Вызов: Auth::isAccessAllowed
static function isAccessAllowed(): bool
{
	global $USER;

	$externalAuthId = $USER->GetParam('EXTERNAL_AUTH_ID');

	if ($USER->IsAdmin() || $externalAuthId === "__controller")
	{
		return true;
	}

	// fake user like as BOT, IMCONNECTOR, SHOP
	$blackList = UserTable::getExternalUserTypes();
	if (in_array($externalAuthId, $blackList, true))
	{
		return false;
	}

	if (!BitrixMainLoader::includeModule('intranet'))
	{
		return true;
	}

	if (BitrixIntranetUtil::isIntranetUser())
	{
		return true;
	}

	if (BitrixIntranetUtil::isExtranetUser())
	{
		return true;
	}

	return false;
}