2019-07-23 04:25:58 -04:00
|
|
|
<?php
|
2026-03-26 12:46:27 -04:00
|
|
|
|
|
|
|
|
// SPDX-FileCopyrightText: 2019 Icinga GmbH <https://icinga.com>
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2019-07-23 04:25:58 -04:00
|
|
|
|
|
|
|
|
namespace Icinga\Authentication;
|
|
|
|
|
|
|
|
|
|
use Icinga\Application\Icinga;
|
|
|
|
|
use Icinga\Repository\IniRepository;
|
|
|
|
|
|
|
|
|
|
class RolesConfig extends IniRepository
|
|
|
|
|
{
|
2024-11-05 03:02:19 -05:00
|
|
|
protected $sortRules = ['name' => ['order' => 'asc']];
|
|
|
|
|
|
2019-07-23 04:25:58 -04:00
|
|
|
protected $configs = [
|
|
|
|
|
'roles' => [
|
|
|
|
|
'name' => 'roles',
|
|
|
|
|
'keyColumn' => 'name'
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected function initializeQueryColumns()
|
|
|
|
|
{
|
|
|
|
|
$columns = [
|
|
|
|
|
'roles' => [
|
2021-02-01 09:04:36 -05:00
|
|
|
'parent',
|
2019-07-23 04:25:58 -04:00
|
|
|
'name',
|
|
|
|
|
'users',
|
|
|
|
|
'groups',
|
2021-01-29 09:48:48 -05:00
|
|
|
'refusals',
|
2019-07-23 04:25:58 -04:00
|
|
|
'permissions',
|
2021-02-02 07:20:29 -05:00
|
|
|
'unrestricted',
|
2019-07-23 04:25:58 -04:00
|
|
|
'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;
|
|
|
|
|
}
|
2025-01-10 10:31:22 -05:00
|
|
|
|
|
|
|
|
protected function initializeSearchColumns(): array
|
|
|
|
|
{
|
|
|
|
|
return ['name'];
|
|
|
|
|
}
|
2019-07-23 04:25:58 -04:00
|
|
|
}
|