• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/user.php
  • Класс: CAllUser
  • Вызов: CAllUser::CanAccess
public function CanAccess($arCodes)
{
	if (!is_array($arCodes) || empty($arCodes))
	{
		return false;
	}

	if (in_array('G2', $arCodes))
	{
		return true;
	}

	if ($this->IsAuthorized() && in_array('AU', $arCodes))
	{
		return true;
	}

	$bEmpty = true;
	foreach ($arCodes as $code)
	{
		if (trim($code) != '')
		{
			$bEmpty = false;
			break;
		}
	}

	if ($bEmpty)
	{
		return false;
	}

	$res = CAccess::GetUserCodes($this->GetID(), ["ACCESS_CODE" => $arCodes]);
	if ($res->Fetch())
	{
		return true;
	}

	return false;
}