Task::addAuditor

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Task
  4. addAuditor
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher/publicaction/task.php
  • Класс: BitrixTasksDispatcherPublicActionTask
  • Вызов: Task::addAuditor
public function addAuditor($id, $auditorId)
{
	$result = [];

	if (
		!TaskAccessController::can($this->userId, ActionDictionary::ACTION_TASK_READ, (int)$id)
	)
	{
		$this->addForbiddenError();
		return $result;
	}

	$task = CTaskItem::getInstance($id, $this->userId);
	try
	{
		$arTask = $task->getData(false);
	}
	catch (TasksException $e)
	{
		return [];
	}
	$arTask['AUDITORS'][] = $auditorId;
	$task->update(array('AUDITORS' => $arTask['AUDITORS']));

	return $result;
}

Добавить комментарий