Show only applied groups in Icinga Host Form
Some checks are pending
L10n Update / update (push) Waiting to run
PHP Tests / Static analysis for php 7.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 7.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 7.4 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.0 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.1 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.3 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 7.4 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.0 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.1 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Waiting to run
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Waiting to run

This commit is contained in:
raviks789 2025-08-01 16:06:36 +02:00 committed by Ravi Kumar Kempapura Srinivasa
parent 4675acc039
commit 5f43bf70aa
2 changed files with 11 additions and 0 deletions

View file

@ -236,6 +236,12 @@ class IcingaHostForm extends DirectorObjectForm
));
$applied = $this->getAppliedGroups();
if ($this->hasHostGroupRestriction()) {
$applied = (new HostgroupRestriction($this->getDb(), $this->getAuth()))
->filterRestrictedHostgroups($applied);
}
if (! empty($applied)) {
$this->addElement('simpleNote', 'applied_groups', [
'label' => $this->translate('Applied groups'),

View file

@ -121,6 +121,11 @@ class HostgroupRestriction extends ObjectRestriction
);
}
public function filterRestrictedHostgroups(array $groups)
{
return array_intersect($groups, $this->listRestrictedHostgroups());
}
/**
* Apply the restriction to the given Hosts Query
*