Skip to content

Commit

Permalink
NavigationController: Show module item types only if accessible by th…
Browse files Browse the repository at this point in the history
…e user

refs #5600
  • Loading branch information
Johannes Meyer committed Sep 21, 2015
1 parent 5f998eb commit 5a494b3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions application/controllers/NavigationController.php
Expand Up @@ -47,11 +47,15 @@ public function init()
*/
protected function listItemTypes()
{
$moduleManager = Icinga::app()->getModuleManager();

$types = $this->defaultItemTypes;
foreach (Icinga::app()->getModuleManager()->getLoadedModules() as $module) {
$moduleTypes = $module->getNavigationItems();
if (! empty($moduleTypes)) {
$types = array_merge($types, $moduleTypes);
foreach ($moduleManager->getLoadedModules() as $module) {
if ($this->hasPermission($moduleManager::MODULE_PERMISSION_NS . $module->getName())) {
$moduleTypes = $module->getNavigationItems();
if (! empty($moduleTypes)) {
$types = array_merge($types, $moduleTypes);
}
}
}

Expand Down

0 comments on commit 5a494b3

Please sign in to comment.