mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-12 08:24:24 +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,14 +206,15 @@ class Menu implements RecursiveIterator
|
|||||||
*/
|
*/
|
||||||
public static function load()
|
public static function load()
|
||||||
{
|
{
|
||||||
/** @var $menu \Icinga\Web\Menu */
|
|
||||||
$menu = new static('menu');
|
$menu = new static('menu');
|
||||||
$menu->addMainMenuItems();
|
$menu->addMainMenuItems();
|
||||||
|
$auth = Manager::getInstance();
|
||||||
$manager = Icinga::app()->getModuleManager();
|
$manager = Icinga::app()->getModuleManager();
|
||||||
foreach ($manager->getLoadedModules() as $module) {
|
foreach ($manager->getLoadedModules() as $module) {
|
||||||
/** @var $module \Icinga\Application\Modules\Module */
|
if ($auth->hasPermission($manager::MODULE_PERMISSION_NS . $module->getName())) {
|
||||||
$menu->mergeSubMenus($module->getMenuItems());
|
$menu->mergeSubMenus($module->getMenuItems());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $menu->order();
|
return $menu->order();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user