Navigation: Add support dashboard-panes and check module permissions
refs #5600
This commit is contained in:
parent
95a61e89a9
commit
6967fffb1f
|
@ -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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue