• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/user.php
  • Класс: CAllUser
  • Вызов: CAllUser::CanDoOperation
public function CanDoOperation($op_name, $user_id = 0)
{
	if ($user_id > 0)
	{
		$arGroups = [];
		$rsGroups = $this->GetUserGroupEx($user_id);
		while ($group = $rsGroups->Fetch())
		{
			$arGroups[] = $group["GROUP_ID"];
		}
		if (!$arGroups)
		{
			return false;
		}

		$op = $this->GetAllOperations($arGroups);
		return isset($op[$op_name]);
	}
	else
	{
		if ($this->IsAdmin())
		{
			return true;
		}

		if (!isset(static::$kernelSession["SESS_OPERATIONS"]))
		{
			static::$kernelSession["SESS_OPERATIONS"] = $this->GetAllOperations();
		}

		return isset(static::$kernelSession["SESS_OPERATIONS"][$op_name]);
	}
}