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

	if (!$this->controller->check(ActionDictionary::ACTION_TASK_READ, $task))
	{
		$this->controller->addError(static::class, 'Access to read task denied');
		return false;
	}

	return !$task->isFavorite($this->user->getUserId());
}