summaryrefslogtreecommitdiff
path: root/app/Helper/ProjectRoleHelper.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-04-05 22:53:54 -0400
committerFrederic Guillot <fred@kanboard.net>2017-04-05 22:53:54 -0400
commit481e767d3533449e63eda1767c5e6c071d3442a3 (patch)
treeac97a2bb3d31078e2f88ea5346bc9745b136903d /app/Helper/ProjectRoleHelper.php
parent22f48ea2897d95c8a31e26a0b3313559de8839d6 (diff)
Add new project restriction to block assignee change
Diffstat (limited to 'app/Helper/ProjectRoleHelper.php')
-rw-r--r--app/Helper/ProjectRoleHelper.php18
1 files changed, 18 insertions, 0 deletions
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
@@ -172,6 +172,24 @@ class ProjectRoleHelper extends Base
}
/**
+ * 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
*
* @param string $controller