From 481e767d3533449e63eda1767c5e6c071d3442a3 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 5 Apr 2017 22:53:54 -0400 Subject: Add new project restriction to block assignee change --- app/Helper/ProjectRoleHelper.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'app/Helper/ProjectRoleHelper.php') diff --git a/app/Helper/ProjectRoleHelper.php b/app/Helper/ProjectRoleHelper.php index fd7a690b..508dc9e0 100644 --- a/app/Helper/ProjectRoleHelper.php +++ b/app/Helper/ProjectRoleHelper.php @@ -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 * -- cgit v1.2.3