• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/replicator/template/taskproducer.php
  • Класс: BitrixTasksReplicatorTemplateTaskProducer
  • Вызов: TaskProducer::checkCanCreateTask
private function checkCanCreateTask(): Result
{
	$result = new Result();
	$model = TaskModel::createFromArray($this->fields);
	if (!$this->accessController->check(ActionDictionary::ACTION_TASK_SAVE, null, $model))
	{
		$result->addErrors($this->accessController->getErrors());

		$message = Loc::getMessage('TASKS_PRODUCER_TASK_WAS_NOT_CREATED');
		if ($message)
		{
			$this->templateHistoryService->write($message, $result);
		}
		return $result;
	}

	return $result;
}