summaryrefslogtreecommitdiff
path: root/app/Model/ProjectRoleModel.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-11 16:08:03 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-11 16:08:03 -0400
commitd8f6d8568396816a6bfaca1e01211384e803cf91 (patch)
tree16d735faa3f6f9aafb6c78650470e77347cae1ab /app/Model/ProjectRoleModel.php
parenta0227cad69aff9486fba1d7b2a19e6da97450100 (diff)
Add project restrictions for custom roles
Diffstat (limited to 'app/Model/ProjectRoleModel.php')
-rw-r--r--app/Model/ProjectRoleModel.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/Model/ProjectRoleModel.php b/app/Model/ProjectRoleModel.php
index 82f22806..ed86d6ed 100644
--- a/app/Model/ProjectRoleModel.php
+++ b/app/Model/ProjectRoleModel.php
@@ -17,7 +17,7 @@ class ProjectRoleModel extends Base
/**
* Get list of project roles
- *
+ *
* @param int $project_id
* @return array
*/
@@ -70,9 +70,14 @@ class ProjectRoleModel extends Base
public function getAllWithRestrictions($project_id)
{
$roles = $this->getAll($project_id);
- $restrictions = $this->columnMoveRestrictionModel->getAll($project_id);
- $restrictions = array_column_index($restrictions, 'role_id');
- array_merge_relation($roles, $restrictions, 'restrictions', 'role_id');
+
+ $column_restrictions = $this->columnMoveRestrictionModel->getAll($project_id);
+ $column_restrictions = array_column_index($column_restrictions, 'role_id');
+ array_merge_relation($roles, $column_restrictions, 'column_restrictions', 'role_id');
+
+ $project_restrictions = $this->projectRoleRestrictionModel->getAll($project_id);
+ $project_restrictions = array_column_index($project_restrictions, 'role_id');
+ array_merge_relation($roles, $project_restrictions, 'project_restrictions', 'role_id');
return $roles;
}