• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/access/rule/taskauditorsaddrule.php
  • Класс: BitrixTasksAccessRuleTaskAuditorsAddRule
  • Вызов: TaskAuditorsAddRule::execute
public function execute(AccessibleItem $task = null, $params = null): bool
{
	if (!$task)
	{
		$this->controller->addError(static::class, 'Incorrect task');
		return false;
	}

	if (!($task instanceof AccessibleTask))
	{
		$this->controller->addError(static::class, 'Incorrect object type');
		return false;
	}

	if ($this->user->isAdmin())
	{
		return true;
	}

	if (!$this->canAssignAuditors($params))
	{
		return false;
	}

	return true;
}