diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-07-28 16:56:37 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-07-28 16:56:37 -0400 |
commit | f3e16da4ac8eb5f06c7f8a0aed49fd3dd11817ec (patch) | |
tree | 1c4ea8b49d63077a49a99c79fd7a96fcaeefadc4 /app | |
parent | 837173cf935a7f5f9c12c69f131a63e0f181d8f3 (diff) |
Allow users to see inactive projects
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/ProjectListController.php | 2 | ||||
-rw-r--r-- | app/Model/ProjectPermissionModel.php | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/app/Controller/ProjectListController.php b/app/Controller/ProjectListController.php index e1172400..4de73c97 100644 --- a/app/Controller/ProjectListController.php +++ b/app/Controller/ProjectListController.php @@ -20,7 +20,7 @@ class ProjectListController extends BaseController if ($this->userSession->isAdmin()) { $project_ids = $this->projectModel->getAllIds(); } else { - $project_ids = $this->projectPermissionModel->getActiveProjectIds($this->userSession->getId()); + $project_ids = $this->projectPermissionModel->getProjectIds($this->userSession->getId()); } $nb_projects = count($project_ids); diff --git a/app/Model/ProjectPermissionModel.php b/app/Model/ProjectPermissionModel.php index a7c1857c..4882343d 100644 --- a/app/Model/ProjectPermissionModel.php +++ b/app/Model/ProjectPermissionModel.php @@ -152,6 +152,18 @@ class ProjectPermissionModel extends Base } /** + * Get all project ids by user + * + * @access public + * @param integer $user_id + * @return array + */ + public function getProjectIds($user_id) + { + return array_keys($this->projectUserRoleModel->getProjectsByUser($user_id)); + } + + /** * Copy permissions to another project * * @param integer $project_src_id Project Template |