new permission to hide user choice in report (#2572)

This commit is contained in:
Kevin Papst
2021-05-16 00:52:42 +02:00
committed by GitHub
parent f7aa3c1e13
commit dd83872339
2 changed files with 3 additions and 2 deletions

View File

@@ -60,7 +60,8 @@ class UserSubscriber extends AbstractActionsSubscriber
$viewOther = $this->isGranted('view_other_timesheet');
if ($this->isGranted('view_reporting')) {
if ($viewOther || ($event->getUser()->getId() === $user->getId())) {
// also found in App\Controller\Reporting\ReportByUserController
if (($viewOther && $this->isGranted('view_other_reporting')) || ($event->getUser()->getId() === $user->getId())) {
$event->addAction('menu.reporting', ['url' => $this->path('report_user_month', ['user' => $user->getId()]), 'icon' => 'reporting']);
}
}