- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/access/rule/taskchangestatusrule.php
- Класс: BitrixTasksAccessRuleTaskChangeStatusRule
- Вызов: TaskChangeStatusRule::execute
public function execute(AccessibleItem $task = null, $params = null): bool
{
if (!$task)
{
$this->controller->addError(static::class, 'Incorrect task');
return false;
}
if ($this->user->isAdmin())
{
return true;
}
if (
$task->isMember($this->user->getUserId(), RoleDictionary::ROLE_DIRECTOR)
|| $task->isMember($this->user->getUserId(), RoleDictionary::ROLE_RESPONSIBLE)
|| $task->isMember($this->user->getUserId(), RoleDictionary::ROLE_ACCOMPLICE)
)
{
return true;
}
if (
$task->getGroupId()
&& Loader::includeModule("socialnetwork")
&& BitrixSocialnetworkInternalsRegistryFeaturePermRegistry::getInstance()->get(
$task->getGroupId(),
'tasks',
'edit_tasks',
$this->user->getUserId()
)
)
{
return true;
}
if ($this->isSubordinateTask($task))
{
return true;
}
$this->controller->addError(static::class, 'Access to change status denied');
return false;
}