mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Don't load module menu entries if the authenticated user lacks the module permission
refs #9644
This commit is contained in:
parent
cccb34e98c
commit
a34ad0227f
@ -206,13 +206,14 @@ class Menu implements RecursiveIterator
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
/** @var $menu \Icinga\Web\Menu */
|
||||
$menu = new static('menu');
|
||||
$menu->addMainMenuItems();
|
||||
$auth = Manager::getInstance();
|
||||
$manager = Icinga::app()->getModuleManager();
|
||||
foreach ($manager->getLoadedModules() as $module) {
|
||||
/** @var $module \Icinga\Application\Modules\Module */
|
||||
$menu->mergeSubMenus($module->getMenuItems());
|
||||
if ($auth->hasPermission($manager::MODULE_PERMISSION_NS . $module->getName())) {
|
||||
$menu->mergeSubMenus($module->getMenuItems());
|
||||
}
|
||||
}
|
||||
return $menu->order();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user