• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/provider/taskquery.php
  • Класс: BitrixTasksProviderTaskQuery
  • Вызов: TaskQuery::needAccessCheck
public function needAccessCheck(): bool
{
	if ($this->skipAccessCheck)
	{
		return false;
	}

	if (TaskAccessController::can($this->userId, ActionDictionary::ACTION_TASK_ADMIN))
	{
		return false;
	}

	if ($this->userId !== $this->behalfUser)
	{
		return true;
	}

	if ($this->makeAccessFilter)
	{
		$runtimeOptions = CTasks::makeAccessFilterRuntimeOptions($this->where, [
			'USER_ID' => $this->userId,
			'VIEWED_USER_ID' =>  $this->behalfUser,
		]);

		if (!CTasks::checkAccessSqlBuilding($runtimeOptions))
		{
			return false;
		}
	}

	return true;
}