Dashboard: show Health to admins only

This commit is contained in:
Thomas Gelf 2018-10-08 06:17:06 +02:00
parent c93657c42e
commit 8cec78a7c3

View File

@ -45,15 +45,18 @@ class DashboardController extends ActionController
$this->tabs()->add('main', [ $this->tabs()->add('main', [
'label' => $this->translate('Overview'), 'label' => $this->translate('Overview'),
'url' => 'director' 'url' => 'director'
])->add('health', [
'label' => $this->translate('Health'),
'url' => 'director/health'
])->activate('main'); ])->activate('main');
$state = $this->getHealthState(); if ($this->hasPermission('director/admin')) {
if ($state->isProblem()) { $this->tabs()->add('health', [
$this->tabs()->get('health')->setTagParams([ 'label' => $this->translate('Health'),
'class' => 'state-' . strtolower($state->getName()) 'url' => 'director/health'
]); ]);
$state = $this->getHealthState();
if ($state->isProblem()) {
$this->tabs()->get('health')->setTagParams([
'class' => 'state-' . strtolower($state->getName())
]);
}
} }
} }