mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Allow to blacklist access to hostgroups
This commit is contained in:
parent
6094639900
commit
af64a656cb
4 changed files with 21 additions and 6 deletions
|
|
@ -19,6 +19,8 @@ class HostgroupController extends Controller
|
|||
|
||||
public function init()
|
||||
{
|
||||
$this->assertRouteAccess('hostgroups');
|
||||
|
||||
$this->setTitle(t('Host Group'));
|
||||
|
||||
$name = $this->params->shiftRequired('name');
|
||||
|
|
|
|||
|
|
@ -18,6 +18,13 @@ use ipl\Web\Url;
|
|||
|
||||
class HostgroupsController extends Controller
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
$this->assertRouteAccess();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->setTitle(t('Host Groups'));
|
||||
|
|
|
|||
|
|
@ -301,10 +301,13 @@ namespace Icinga\Module\Icingadb
|
|||
]);
|
||||
}
|
||||
|
||||
$section->add(N_('Host Groups'), [
|
||||
'url' => 'icingadb/hostgroups',
|
||||
'priority' => 80
|
||||
]);
|
||||
if (! array_key_exists('hostgroups', $routeBlacklist)) {
|
||||
$section->add(N_('Host Groups'), [
|
||||
'url' => 'icingadb/hostgroups',
|
||||
'priority' => 80
|
||||
]);
|
||||
}
|
||||
|
||||
$section->add(N_('Service Groups'), [
|
||||
'url' => 'icingadb/servicegroups',
|
||||
'priority' => 80
|
||||
|
|
|
|||
|
|
@ -191,8 +191,11 @@ class ObjectDetail extends BaseHtmlElement
|
|||
$groups = [Html::tag('h2', t('Groups'))];
|
||||
|
||||
if ($this->objectType === 'host') {
|
||||
$hostgroups = $this->object->hostgroup;
|
||||
$this->applyRestrictions($hostgroups);
|
||||
$hostgroups = [];
|
||||
if ($this->isPermittedRoute('hostgroups')) {
|
||||
$hostgroups = $this->object->hostgroup;
|
||||
$this->applyRestrictions($hostgroups);
|
||||
}
|
||||
|
||||
$hostgroupList = new TagList();
|
||||
foreach ($hostgroups as $hostgroup) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue