diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-14 15:43:08 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-14 15:43:08 -0400 |
commit | b2cce5a3a1a0be68102e614b42d2ee6a030bd523 (patch) | |
tree | 0014f4362cee39f98727276bc79aa96adc213fee /app/Controller/Project.php | |
parent | 80fb3bc9aa842ef75f1f8282db63ca43282aacd7 (diff) |
Add new role Project Administrator
Diffstat (limited to 'app/Controller/Project.php')
-rw-r--r-- | app/Controller/Project.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/Controller/Project.php b/app/Controller/Project.php index 45bc2a46..9309cfae 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -141,8 +141,15 @@ class Project extends Base $project = $this->getProject(); $values = $this->request->getValues(); - if ($project['is_private'] == 1 && $this->userSession->isAdmin() && ! isset($values['is_private'])) { - $values += array('is_private' => 0); + if (isset($values['is_private'])) { + if (! $this->helper->user->isProjectAdministrationAllowed($project['id'])) { + unset($values['is_private']); + } + } + else if ($project['is_private'] == 1 && ! isset($values['is_private'])) { + if ($this->helper->user->isProjectAdministrationAllowed($project['id'])) { + $values += array('is_private' => 0); + } } list($valid, $errors) = $this->project->validateModification($values); @@ -402,7 +409,7 @@ class Project extends Base */ public function create(array $values = array(), array $errors = array()) { - $is_private = $this->request->getIntegerParam('private', $this->userSession->isAdmin() ? 0 : 1); + $is_private = $this->request->getIntegerParam('private', $this->userSession->isAdmin() || $this->userSession->isProjectAdmin() ? 0 : 1); $this->response->html($this->template->layout('project/new', array( 'board_selector' => $this->projectPermission->getAllowedProjects($this->userSession->getId()), |