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', [
'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())
]);
}
}
}