Add new project restriction to block assignee change

This commit is contained in:
Frederic Guillot
2017-04-05 22:53:54 -04:00
parent 22f48ea289
commit 481e767d35
6 changed files with 93 additions and 10 deletions

View File

@@ -171,6 +171,24 @@ class ProjectRoleHelper extends Base
return false;
}
/**
* Return true if the user can change assignee
*
* @public
* @param array $task
* @return bool
*/
public function canChangeAssignee(array $task)
{
$role = $this->getProjectUserRole($task['project_id']);
if ($this->hasRestriction($task['project_id'], $role, ProjectRoleRestrictionModel::RULE_TASK_CHANGE_ASSIGNEE)) {
return false;
}
return true;
}
/**
* Check project access
*