From 8713f59e66642b68e6016b69beb22a66fcab6f52 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 27 May 2015 10:38:35 +0200 Subject: [PATCH] AuthBackendController: Only show tabs the user is permitted to view refs #8826 --- .../Web/Controller/AuthBackendController.php | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/library/Icinga/Web/Controller/AuthBackendController.php b/library/Icinga/Web/Controller/AuthBackendController.php index 1f93de1c7..5b2a4f18e 100644 --- a/library/Icinga/Web/Controller/AuthBackendController.php +++ b/library/Icinga/Web/Controller/AuthBackendController.php @@ -138,24 +138,30 @@ class AuthBackendController extends Controller protected function createListTabs() { $tabs = $this->getTabs(); - $tabs->add( - 'user/list', - array( - 'title' => $this->translate('List users of authentication backends'), - 'label' => $this->translate('Users'), - 'icon' => 'user', - 'url' => 'user/list' - ) - ); - $tabs->add( - 'group/list', - array( - 'title' => $this->translate('List groups of user group backends'), - 'label' => $this->translate('Groups'), - 'icon' => 'users', - 'url' => 'group/list' - ) - ); + + if ($this->hasPermission('config/application/users/show')) { + $tabs->add( + 'user/list', + array( + 'title' => $this->translate('List users of authentication backends'), + 'label' => $this->translate('Users'), + 'icon' => 'user', + 'url' => 'user/list' + ) + ); + } + + if ($this->hasPermission('config/application/groups/show')) { + $tabs->add( + 'group/list', + array( + 'title' => $this->translate('List groups of user group backends'), + 'label' => $this->translate('Groups'), + 'icon' => 'users', + 'url' => 'group/list' + ) + ); + } return $tabs; }