From 28bc4246bff405367c9e5640bca356b307962026 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 1 Mar 2014 19:51:09 -0500 Subject: Add acl and access list for projects --- controllers/user.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'controllers/user.php') diff --git a/controllers/user.php b/controllers/user.php index 9f9781ef..10d3ad21 100644 --- a/controllers/user.php +++ b/controllers/user.php @@ -68,8 +68,6 @@ class User extends Base // Display a form to create a new user public function create() { - $this->checkPermissions(); - $this->response->html($this->template->layout('user_new', array( 'projects' => $this->project->getList(), 'errors' => array(), @@ -82,8 +80,6 @@ class User extends Base // Validate and save a new user public function save() { - $this->checkPermissions(); - $values = $this->request->getValues(); list($valid, $errors) = $this->user->validateCreation($values); @@ -121,7 +117,7 @@ class User extends Base unset($user['password']); $this->response->html($this->template->layout('user_edit', array( - 'projects' => $this->project->getList(), + 'projects' => $this->project->filterListByAccess($this->project->getList(), $user['id']), 'errors' => array(), 'values' => $user, 'menu' => 'users', @@ -162,7 +158,7 @@ class User extends Base } $this->response->html($this->template->layout('user_edit', array( - 'projects' => $this->project->getList(), + 'projects' => $this->project->filterListByAccess($this->project->getList(), $values['id']), 'errors' => $errors, 'values' => $values, 'menu' => 'users', @@ -173,8 +169,6 @@ class User extends Base // Confirmation dialog before to remove a user public function confirm() { - $this->checkPermissions(); - $user = $this->user->getById($this->request->getIntegerParam('user_id')); if (! $user) $this->notfound(); @@ -189,8 +183,6 @@ class User extends Base // Remove a user public function remove() { - $this->checkPermissions(); - $user_id = $this->request->getIntegerParam('user_id'); if ($user_id && $this->user->remove($user_id)) { -- cgit v1.2.3