mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 00:34:05 +02:00
Backend: Remove unnecessary calls to isAvailable()
This commit is contained in:
parent
eeaf87741a
commit
db7181c29e
@ -568,7 +568,6 @@ class HostController extends ObjectController
|
|||||||
try {
|
try {
|
||||||
$backend = $this->backend();
|
$backend = $this->backend();
|
||||||
if ($host instanceof IcingaHost
|
if ($host instanceof IcingaHost
|
||||||
&& $backend->isAvailable()
|
|
||||||
&& $host->isObject()
|
&& $host->isObject()
|
||||||
&& $backend->hasHost($host->getObjectName())
|
&& $backend->hasHost($host->getObjectName())
|
||||||
) {
|
) {
|
||||||
|
@ -44,8 +44,7 @@ class HostActions extends HostActionsHook
|
|||||||
$allowEdit = true;
|
$allowEdit = true;
|
||||||
}
|
}
|
||||||
if (Util::hasPermission('director/monitoring/hosts')) {
|
if (Util::hasPermission('director/monitoring/hosts')) {
|
||||||
$backend = new IcingadbBackend();
|
if ((new IcingadbBackend())->canModifyHost($hostname)) {
|
||||||
if ($backend->isAvailable() && $backend->canModifyHost($hostname)) {
|
|
||||||
$allowEdit = IcingaHost::exists($hostname, $db);
|
$allowEdit = IcingaHost::exists($hostname, $db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,10 +56,7 @@ class ServiceActions extends ServiceActionsHook
|
|||||||
if (Util::hasPermission('director/hosts')) {
|
if (Util::hasPermission('director/hosts')) {
|
||||||
$title = mt('director', 'Modify');
|
$title = mt('director', 'Modify');
|
||||||
} elseif (Util::hasPermission('director/monitoring/services')) {
|
} elseif (Util::hasPermission('director/monitoring/services')) {
|
||||||
$backend = new IcingadbBackend();
|
if ((new IcingadbBackend())->canModifyService($hostname, $serviceName)) {
|
||||||
if ($backend->isAvailable()
|
|
||||||
&& $backend->canModifyService($hostname, $serviceName)
|
|
||||||
) {
|
|
||||||
$title = mt('director', 'Modify');
|
$title = mt('director', 'Modify');
|
||||||
}
|
}
|
||||||
} elseif (Util::hasPermission('director/monitoring/services-ro')) {
|
} elseif (Util::hasPermission('director/monitoring/services-ro')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user