From 9de9fe8f391b06223f00a2d528c721a8be0ceabd Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 23 Jul 2019 10:25:58 +0200 Subject: [PATCH] Introduce class RolesConfig --- library/Icinga/Authentication/RolesConfig.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 library/Icinga/Authentication/RolesConfig.php diff --git a/library/Icinga/Authentication/RolesConfig.php b/library/Icinga/Authentication/RolesConfig.php new file mode 100644 index 000000000..51f07cc3b --- /dev/null +++ b/library/Icinga/Authentication/RolesConfig.php @@ -0,0 +1,40 @@ + [ + 'name' => 'roles', + 'keyColumn' => 'name' + ] + ]; + + protected function initializeQueryColumns() + { + $columns = [ + 'roles' => [ + 'name', + 'users', + 'groups', + 'permissions', + 'application/share/users', + 'application/share/groups' + ] + ]; + + $moduleManager = Icinga::app()->getModuleManager(); + foreach ($moduleManager->listInstalledModules() as $moduleName) { + foreach ($moduleManager->getModule($moduleName, false)->getProvidedRestrictions() as $restriction) { + $columns['roles'][] = $restriction->name; + } + } + + return $columns; + } +}