Navigation: Add support dashboard-panes and check module permissions

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-04 15:51:51 +02:00
parent 95a61e89a9
commit 6967fffb1f
1 changed files with 8 additions and 3 deletions

View File

@ -391,9 +391,14 @@ class Navigation implements ArrayAccess, Countable, IteratorAggregate
*/ */
public function load($type) public function load($type)
{ {
foreach (Icinga::app()->getModuleManager()->getLoadedModules() as $module) { $moduleManager = Icinga::app()->getModuleManager();
if ($type === 'menu-item') { foreach ($moduleManager->getLoadedModules() as $module) {
$this->merge($module->getMenu()); 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());
}
} }
} }