From 8cec78a7c38f0f76756907ac45bd85550e0918a4 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 8 Oct 2018 06:17:06 +0200 Subject: [PATCH] Dashboard: show Health to admins only --- application/controllers/DashboardController.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index 18c45fbe..a18ad40e 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -45,15 +45,18 @@ class DashboardController extends ActionController $this->tabs()->add('main', [ 'label' => $this->translate('Overview'), 'url' => 'director' - ])->add('health', [ - 'label' => $this->translate('Health'), - 'url' => 'director/health' ])->activate('main'); - $state = $this->getHealthState(); - if ($state->isProblem()) { - $this->tabs()->get('health')->setTagParams([ - 'class' => 'state-' . strtolower($state->getName()) + if ($this->hasPermission('director/admin')) { + $this->tabs()->add('health', [ + 'label' => $this->translate('Health'), + 'url' => 'director/health' ]); + $state = $this->getHealthState(); + if ($state->isProblem()) { + $this->tabs()->get('health')->setTagParams([ + 'class' => 'state-' . strtolower($state->getName()) + ]); + } } }