• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/access/rule/taskchangeaccomplicesrule.php
  • Класс: BitrixTasksAccessRuleTaskChangeAccomplicesRule
  • Вызов: TaskChangeAccomplicesRule::canChangeAccomplices
private function canChangeAccomplices(AccessibleItem $task): bool
{
	if (!$task->getId())
	{
		return true;
	}

	if (
		$task->isMember($this->user->getUserId(), RoleDictionary::ROLE_DIRECTOR)
	)
	{
		return true;
	}

	if (
		$task->isMember($this->user->getUserId(), RoleDictionary::ROLE_RESPONSIBLE)
		&& $this->user->getPermission(PermissionDictionary::TASK_RESPONSE_ASSIGN)
	)
	{
		return true;
	}

	if (
		$task->getGroupId()
		&& Loader::includeModule("socialnetwork")
		&& BitrixSocialnetworkInternalsRegistryFeaturePermRegistry::getInstance()->get(
			$task->getGroupId(),
			'tasks',
			'edit_tasks',
			$this->user->getUserId()
		)
	)
	{
		return true;
	}

	if (array_intersect($task->getMembers(RoleDictionary::ROLE_DIRECTOR), $this->user->getAllSubordinates()))
	{
		return true;
	}

	return false;
}