Show service and host nodes for filtered roles

The service and host nodes must be shown, but clicking on these nodes should show
"Access Denied" page.
This commit is contained in:
raviks789 2022-08-10 11:52:43 +02:00 committed by Johannes Meyer
parent b24600893a
commit 4ca8c72a05
3 changed files with 2 additions and 6 deletions

View file

@ -44,7 +44,7 @@ class HostController extends Controller
$this->params->add('name', $hostName);
if ($host !== false) {
if ($host !== null) {
$this->redirectNow(Url::fromPath('icingadb/host')->setParams($this->params));
}
} else {

View file

@ -49,7 +49,7 @@ class ServiceController extends Controller
$this->params->add('name', $serviceName);
$this->params->add('host.name', $hostName);
if ($service !== false) {
if ($service !== null) {
$this->redirectNow(Url::fromPath('icingadb/service')->setParams($this->params));
}
} else {

View file

@ -63,8 +63,6 @@ class IcingaDbState
}
$queryHost = Host::on($this->backend)->with('state');
IcingaDbObject::applyIcingaDbRestrictions($queryHost);
$queryHost->filter(Filter::equal('host.name', $hosts));
$hostObject = $queryHost->getModel()->getTableName();
@ -78,8 +76,6 @@ class IcingaDbState
$queryService->filter(Filter::equal('host.name', $hosts));
IcingaDbObject::applyIcingaDbRestrictions($queryService);
Benchmark::measure('Retrieved states for ' . $queryService->count() . ' services in ' . $config->getName());
$configs = $config->listInvolvedConfigs();