new permission to hide user choice in report (#2572)
This commit is contained in:
@@ -42,7 +42,7 @@ final class ReportByUserController extends AbstractController
|
|||||||
private function canSelectUser(): bool
|
private function canSelectUser(): bool
|
||||||
{
|
{
|
||||||
// also found in App\EventSubscriber\Actions\UserSubscriber
|
// also found in App\EventSubscriber\Actions\UserSubscriber
|
||||||
if (!$this->isGranted('view_other_timesheet')) {
|
if (!$this->isGranted('view_other_timesheet') || !$this->isGranted('view_other_reporting')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ class UserSubscriber extends AbstractActionsSubscriber
|
|||||||
|
|
||||||
$viewOther = $this->isGranted('view_other_timesheet');
|
$viewOther = $this->isGranted('view_other_timesheet');
|
||||||
if ($this->isGranted('view_reporting')) {
|
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']);
|
$event->addAction('menu.reporting', ['url' => $this->path('report_user_month', ['user' => $user->getId()]), 'icon' => 'reporting']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user