NavigationController: Show module item types only if accessible by the user
refs #5600
This commit is contained in:
parent
5f998eb56d
commit
5a494b3088
|
@ -47,11 +47,15 @@ class NavigationController extends Controller
|
|||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue