• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/classes/general/rest.php
  • Класс: CRestServerBatchItem
  • Вызов: CRestServerBatchItem::checkAuth
protected function checkAuth()
{
	foreach($this->authKeys as $param)
	{
		if(array_key_exists($param, $this->query))
		{
			$this->auth[$param] = $this->query[$param];
			unset($this->query[$param]);
		}
	}

	if($this->scope !== CRestUtil::GLOBAL_SCOPE)
	{
		$allowedScope = explode(',', $this->authData['scope']);
		$allowedScope = BitrixRestEngineRestManager::fillAlternativeScope($this->scope, $allowedScope);
		if(!in_array($this->scope, $allowedScope))
		{
			throw new BitrixRestOAuthException(array('error' => 'insufficient_scope'));
		}
	}

	return true;
}