Merge branch 'fix/host-templates-not-usable-with-hostgroup-restriction-#2020'

This commit is contained in:
Thomas Gelf 2020-04-01 20:56:46 +02:00
commit b6284e7898
1 changed files with 3 additions and 5 deletions

View File

@ -57,13 +57,11 @@ class HostgroupRestriction extends ObjectRestriction
} }
if (! $host->hasBeenLoadedFromDb()) { if (! $host->hasBeenLoadedFromDb()) {
if ($host->hasModifiedGroups()) {
foreach ($this->listRestrictedHostgroups() as $group) { foreach ($this->listRestrictedHostgroups() as $group) {
if ($host->hasGroup($group)) { if ($host->hasGroup($group)) {
return true; return true;
} }
} }
}
return false; return false;
} }