From d6f6586ba9a0676eab86427f7948406e23efed3a Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@git-test.afi-sa.fr> Date: Wed, 20 Nov 2013 11:31:02 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20acc=C3=A8s=20catalogue=20r=C3=A9da?= =?UTF-8?q?cteur=20portail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/views/scripts/catalogue/_catalogue_row.phtml | 2 +- library/Class/Users.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/application/modules/admin/views/scripts/catalogue/_catalogue_row.phtml b/application/modules/admin/views/scripts/catalogue/_catalogue_row.phtml index 9ce9c94a797..2d569ecd6ad 100644 --- a/application/modules/admin/views/scripts/catalogue/_catalogue_row.phtml +++ b/application/modules/admin/views/scripts/catalogue/_catalogue_row.phtml @@ -7,7 +7,7 @@ $actions = [ ['action' => 'tester', 'icon' => 'ico/tester.gif', 'help' => 'Tester'] ]; - if (Class_Users::getIdentity()->isAdmin()) { + if (Class_Users::getIdentity()->isRoleMoreThanModoBib()) { $actions = array_merge($actions, [ ['action' => 'edit', 'icon' => 'ico/edit.gif', 'help' => 'Editer'], ['action' => 'duplicate', 'icon' => 'ico/copier.gif', 'help' => 'Dupliquer'], diff --git a/library/Class/Users.php b/library/Class/Users.php index 5eabd1284de..c5c5d366734 100644 --- a/library/Class/Users.php +++ b/library/Class/Users.php @@ -339,6 +339,14 @@ class Class_Users extends Storm_Model_Abstract { } + /** + * @return bool + */ + public function isRoleMoreThanModoBib() { + return $this->getRoleLevel() > ZendAfi_Acl_AdminControllerRoles::MODO_BIB; + } + + /** * @return bool */ @@ -591,7 +599,7 @@ class Class_Users extends Storm_Model_Abstract { * @return bool */ public function hasRightAccessDomaines() { - return $this->isAdmin() || in_array(Class_UserGroup::RIGHT_USER_DOMAINES_SUPPRESSION_LIMIT, $this->getRights()); + return $this->isRoleMoreThanModoBib() || in_array(Class_UserGroup::RIGHT_USER_DOMAINES_SUPPRESSION_LIMIT, $this->getRights()); } -- GitLab