(Multi)QuickActions: Hide Process check button when related feature command is disabled

This commit is contained in:
Sukhwinder Dhillon 2025-01-09 13:01:23 +01:00 committed by Johannes Meyer
parent c4a8f4748f
commit 63379898ac
2 changed files with 6 additions and 1 deletions

View file

@ -120,6 +120,7 @@ class MultiselectQuickActions extends BaseHtmlElement
$unacknowledged = "{$this->getColumnPrefix()}_problems_unacknowledged";
$acks = "{$this->getColumnPrefix()}_acknowledged";
$activeChecks = "{$this->getColumnPrefix()}_active_checks_enabled";
$passiveChecks = "{$this->getColumnPrefix()}_passive_checks_enabled";
if (
$this->summary->$unacknowledged > $this->summary->$acks
@ -233,6 +234,7 @@ class MultiselectQuickActions extends BaseHtmlElement
if (
$this->allowToProcessCheckResults
&& $this->summary->$passiveChecks > 0
&& $this->isGrantedOnType(
'icingadb/command/process-check-result',
$this->type,

View file

@ -104,7 +104,10 @@ class QuickActions extends BaseHtmlElement
);
}
if ($this->isGrantedOn('icingadb/command/process-check-result', $this->object)) {
if (
$this->object->passive_checks_enabled
&& $this->isGrantedOn('icingadb/command/process-check-result', $this->object)
) {
$this->assembleAction(
'processCheckresult',
t('Process check result'),