mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix: Fix bug reported by the tests.
This commit is contained in:
parent
c1a4454a08
commit
11ad94ee09
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user