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,10 +45,12 @@ class DashboardController extends ActionController
$this->tabs()->add('main', [
'label' => $this->translate('Overview'),
'url' => 'director'
])->add('health', [
])->activate('main');
if ($this->hasPermission('director/admin')) {
$this->tabs()->add('health', [
'label' => $this->translate('Health'),
'url' => 'director/health'
])->activate('main');
]);
$state = $this->getHealthState();
if ($state->isProblem()) {
$this->tabs()->get('health')->setTagParams([
@ -56,6 +58,7 @@ class DashboardController extends ActionController
]);
}
}
}
$cntDashboards = 0;
foreach ($names as $name) {