- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/access/rule/taskdeferrule.php
- Класс: BitrixTasksAccessRuleTaskDeferRule
- Вызов: TaskDeferRule::execute
public function execute(AccessibleItem $task = null, $params = null): bool
{
if (!$task)
{
$this->controller->addError(static::class, 'Incorrect task');
return false;
}
if (!in_array((int)$task->getStatus(), [Status::NEW, Status::PENDING], true))
{
$this->controller->addError(static::class, 'Incorrect status');
return false;
}
if ($this->user->isAdmin())
{
return true;
}
if (
$task->isMember($this->user->getUserId(), RoleDictionary::ROLE_RESPONSIBLE)
|| $task->isMember($this->user->getUserId(), RoleDictionary::ROLE_DIRECTOR)
|| $task->isMember($this->user->getUserId(), RoleDictionary::ROLE_ACCOMPLICE)
)
{
return true;
}
return $this->controller->check(ActionDictionary::ACTION_TASK_EDIT, $task);
}