From 6967fffb1f62332adee50954093d827df3fdd5f9 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 4 Sep 2015 15:51:51 +0200 Subject: [PATCH] Navigation: Add support dashboard-panes and check module permissions refs #5600 --- library/Icinga/Web/Navigation/Navigation.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Web/Navigation/Navigation.php b/library/Icinga/Web/Navigation/Navigation.php index 1500f9b9b..2cf4376fa 100644 --- a/library/Icinga/Web/Navigation/Navigation.php +++ b/library/Icinga/Web/Navigation/Navigation.php @@ -391,9 +391,14 @@ class Navigation implements ArrayAccess, Countable, IteratorAggregate */ public function load($type) { - foreach (Icinga::app()->getModuleManager()->getLoadedModules() as $module) { - if ($type === 'menu-item') { - $this->merge($module->getMenu()); + $moduleManager = Icinga::app()->getModuleManager(); + foreach ($moduleManager->getLoadedModules() as $module) { + if (Auth::getInstance()->hasPermission($moduleManager::MODULE_PERMISSION_NS . $module->getName())) { + if ($type === 'menu-item') { + $this->merge($module->getMenu()); + } elseif ($type === 'dashboard-pane') { + $this->merge($module->getDashboard()); + } } }