dashboard is missing in initial view (#974)

This commit is contained in:
Kevin Papst
2019-07-24 14:47:07 +02:00
committed by GitHub
parent dae8866053
commit 39abccb35d

View File

@@ -35,7 +35,7 @@ class InitialViewType extends AbstractType
]; ];
protected const ROUTE_PERMISSION = [ protected const ROUTE_PERMISSION = [
'dashboard' => 'menu.homepage', 'dashboard' => '',
'timesheet' => 'view_own_timesheet', 'timesheet' => 'view_own_timesheet',
'calendar' => 'view_own_timesheet', 'calendar' => 'view_own_timesheet',
'my_profile' => 'view_own_profile', 'my_profile' => 'view_own_profile',
@@ -67,7 +67,7 @@ class InitialViewType extends AbstractType
{ {
$choices = []; $choices = [];
foreach (self::ROUTE_PERMISSION as $route => $permission) { foreach (self::ROUTE_PERMISSION as $route => $permission) {
if ($this->voter->isGranted($permission)) { if (empty($permission) || $this->voter->isGranted($permission)) {
$name = self::ALLOWED_VIEWS[$route]; $name = self::ALLOWED_VIEWS[$route];
$choices[$name] = $route; $choices[$name] = $route;
} }