diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-04-07 21:46:36 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-04-07 21:46:36 -0400 |
commit | 003c03a4e6a73dfa3633ba756e3647bf9d4517a5 (patch) | |
tree | 1a32db21cd8d4f28a08d928f48c2532d50deae07 /app/Helper/ProjectRoleHelper.php | |
parent | 481e767d3533449e63eda1767c5e6c071d3442a3 (diff) |
Add project restriction to block task edition
Diffstat (limited to 'app/Helper/ProjectRoleHelper.php')
-rw-r--r-- | app/Helper/ProjectRoleHelper.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Helper/ProjectRoleHelper.php b/app/Helper/ProjectRoleHelper.php index 508dc9e0..295b8b3e 100644 --- a/app/Helper/ProjectRoleHelper.php +++ b/app/Helper/ProjectRoleHelper.php @@ -190,6 +190,24 @@ class ProjectRoleHelper extends Base } /** + * Return true if the user can update a task + * + * @public + * @param array $task + * @return bool + */ + public function canUpdateTask(array $task) + { + $role = $this->getProjectUserRole($task['project_id']); + + if ($task['owner_id'] != $this->userSession->getId() && $this->hasRestriction($task['project_id'], $role, ProjectRoleRestrictionModel::RULE_TASK_UPDATE_ASSIGNED)) { + return false; + } + + return true; + } + + /** * Check project access * * @param string $controller |