diff --git a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php index a0e77bbaa..448232e4f 100644 --- a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php +++ b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php @@ -87,8 +87,7 @@ class TimelineReportProvider implements TimelineProviderInterface $report = $this->em->getClassMetadata(Report::class); $person = $this->em->getClassMetadata(Person::class); $role = new Role('CHILL_REPORT_SEE'); - $reachableCenters = $this->helper->getReachableCenters($this->security->getUser(), - $role); + $reachableCenters = $this->helper->getReachableCenters($this->security->getUser(), $role->getRole()); $reportPersonId = $report->getAssociationMapping('person')['joinColumns'][0]['name']; $reportScopeId = $report->getAssociationMapping('scope')['joinColumns'][0]['name']; $personCenterId = $person->getAssociationMapping('center')['joinColumns'][0]['name']; @@ -111,8 +110,7 @@ class TimelineReportProvider implements TimelineProviderInterface $parameters[] = $center->getId(); // loop over scopes $scopeIds = []; - foreach ($this->helper->getReachableScopes($this->security->getUser(), - $role, $center) as $scope) { + foreach ($this->helper->getReachableScopes($this->security->getUser(), $role->getRole(), $center) as $scope) { if (\in_array($scope->getId(), $scopeIds)) { continue; } @@ -158,8 +156,7 @@ class TimelineReportProvider implements TimelineProviderInterface // this is the final clause that we are going to fill $clause = "{report}.{person_id} = ? AND {report}.{scopes_id} IN ({scopes_ids})"; // iterate over reachable scopes - $scopes = $this->helper->getReachableScopes($this->security->getUser(), $role, - $args['person']->getCenter()); + $scopes = $this->helper->getReachableScopes($this->security->getUser(), $role->getRole(), $args['person']->getCenter()); foreach ($scopes as $scope) { if (\in_array($scope->getId(), $parameters)) {