From 08e8d5d74236c892622eb82447d0c58ebffc411d Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 23 Jan 2015 10:48:21 +0100 Subject: [PATCH] monitoring/security: Hide 'Process check result' link if user lacks the respective permission --- .../scripts/show/components/command.phtml | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/modules/monitoring/application/views/scripts/show/components/command.phtml b/modules/monitoring/application/views/scripts/show/components/command.phtml index dd8996d58..5239dad41 100644 --- a/modules/monitoring/application/views/scripts/show/components/command.phtml +++ b/modules/monitoring/application/views/scripts/show/components/command.phtml @@ -3,25 +3,32 @@ $parts = explode('!', $object->check_command); $command = array_shift($parts); -?> - translate('Command') ?> - - escape($command) ?> - passive_checks_enabled): ?> - getType() === $object::TYPE_HOST): ?> - icon('reply'); ?> translate('Process check result'); ?> - - icon('reply'); ?> translate('Process check result'); ?> - - - +?> + + + translate('Command') ?> + + escape($command) ?> + hasPermission('monitoring/command/schedule-check') && $object->passive_checks_enabled): ?> + getType() === $object::TYPE_HOST) { + $processCheckResult = $this->href( + 'monitoring/host/process-check-result', + array('host' => $object->getName()) + ); + } else { + $processCheckResult = $this->href( + 'monitoring/service/process-check-result', + array('host' => $object->getHost()->getName(), 'service' => $object->getName()) + ); + } ?> + + icon('reply') ?> + translate('Process check result') ?> + + + + \n %s\n %s\n\n";