summaryrefslogtreecommitdiff
path: root/app/Model/ProjectPermissionModel.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-18 21:19:48 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-18 21:19:48 -0400
commit3043163747b13ce1942b2e55977cf7c5417021de (patch)
tree31552d8bfdf3b7a6eedfaded116b863e980f86b4 /app/Model/ProjectPermissionModel.php
parent4bc83646b0b15bff9ae55083121f66b7a89e433d (diff)
Add column restrictions to custom project roles
Diffstat (limited to 'app/Model/ProjectPermissionModel.php')
-rw-r--r--app/Model/ProjectPermissionModel.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/Model/ProjectPermissionModel.php b/app/Model/ProjectPermissionModel.php
index 4882343d..25b6a382 100644
--- a/app/Model/ProjectPermissionModel.php
+++ b/app/Model/ProjectPermissionModel.php
@@ -122,8 +122,13 @@ class ProjectPermissionModel extends Base
*/
public function isAssignable($project_id, $user_id)
{
- return $this->userModel->isActive($user_id) &&
- in_array($this->projectUserRoleModel->getUserRole($project_id, $user_id), array(Role::PROJECT_MEMBER, Role::PROJECT_MANAGER));
+ if ($this->userModel->isActive($user_id)) {
+ $role = $this->projectUserRoleModel->getUserRole($project_id, $user_id);
+
+ return ! empty($role) && $role !== Role::PROJECT_VIEWER;
+ }
+
+ return false;
}
/**