From c3acea55ad7b0c70e1740b59074be9436df34976 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Thu, 9 Jan 2025 13:01:23 +0100 Subject: [PATCH] QuickActions: Hide `Process check` and `Notification` button when related feature command is disabled --- library/Icingadb/Widget/Detail/QuickActions.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/library/Icingadb/Widget/Detail/QuickActions.php b/library/Icingadb/Widget/Detail/QuickActions.php index 2ea26c26a..6d2c511a5 100644 --- a/library/Icingadb/Widget/Detail/QuickActions.php +++ b/library/Icingadb/Widget/Detail/QuickActions.php @@ -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'), @@ -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'),