From f958a1c3236485cde5b726c393a3168f56981f15 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 7 Sep 2015 12:20:14 +0200 Subject: [PATCH] Navigation: Load a user's navigation items refs #5600 --- library/Icinga/Web/Navigation/Navigation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Navigation/Navigation.php b/library/Icinga/Web/Navigation/Navigation.php index 8b0990e2e..77128e308 100644 --- a/library/Icinga/Web/Navigation/Navigation.php +++ b/library/Icinga/Web/Navigation/Navigation.php @@ -413,9 +413,12 @@ class Navigation implements ArrayAccess, Countable, IteratorAggregate */ public function load($type) { + $user = Auth::getInstance()->getUser(); + $this->merge($user->getNavigation($type)); + $moduleManager = Icinga::app()->getModuleManager(); foreach ($moduleManager->getLoadedModules() as $module) { - if (Auth::getInstance()->hasPermission($moduleManager::MODULE_PERMISSION_NS . $module->getName())) { + if ($user->can($moduleManager::MODULE_PERMISSION_NS . $module->getName())) { if ($type === 'menu-item') { $this->merge($module->getMenu()); } elseif ($type === 'dashboard-pane') {