mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 10:57:41 +02:00
Fix host templates not usable with hostgroup restrictions
Before, for new hosts the code checked whether the host is part of any restricted hostgroup only if the host's groups got modified directly. I honestly don't know how that should be possible, since one can't add host groups directly if restricted. Now, for new hosts the code checks whether the resolved host groups match at least one of the restricted host groups.
This commit is contained in:
parent
bf0653d238
commit
db97470a48
@ -57,11 +57,9 @@ class HostgroupRestriction extends ObjectRestriction
|
||||
}
|
||||
|
||||
if (! $host->hasBeenLoadedFromDb()) {
|
||||
if ($host->hasModifiedGroups()) {
|
||||
foreach ($this->listRestrictedHostgroups() as $group) {
|
||||
if ($host->hasGroup($group)) {
|
||||
return true;
|
||||
}
|
||||
foreach ($this->listRestrictedHostgroups() as $group) {
|
||||
if ($host->hasGroup($group)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user