Skip to content

Commit

Permalink
QuickActions: Hide Process check and Notification button when rel…
Browse files Browse the repository at this point in the history
…ated feature command is disabled
  • Loading branch information
sukhwinder33445 committed Jan 9, 2025
1 parent 4806939 commit c3acea5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions library/Icingadb/Widget/Detail/QuickActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ protected function assemble()
);
}

if ($this->isGrantedOn('icingadb/command/send-custom-notification', $this->object)) {
if (
$this->isGrantedOn('icingadb/command/send-custom-notification', $this->object)
&& $this->object->notifications_enabled //TODO: not sure, Model contains a forced switch
) {
$this->assembleAction(
'sendCustomNotification',
t('Notification'),
Expand Down Expand Up @@ -104,7 +107,10 @@ protected function assemble()
);
}

if ($this->isGrantedOn('icingadb/command/process-check-result', $this->object)) {
if (
$this->isGrantedOn('icingadb/command/process-check-result', $this->object)
&& $this->object->passive_checks_enabled
) {
$this->assembleAction(
'processCheckresult',
t('Process check result'),
Expand Down

0 comments on commit c3acea5

Please sign in to comment.