From 56a17a0bcd56b6ac5fabda68bede2bcf81a78581 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 31 Jan 2023 14:38:51 +0100 Subject: [PATCH] FIX [parcours][repo] if user is not within scope of the parcours, but (s)he is the referrer the parcours will appear in the list of parcours of a person --- .../Repository/AccompanyingPeriodACLAwareRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index 7de509f1f..e28832bf9 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -187,8 +187,12 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC ); foreach ($scopes as $key => $scope) { - $orx->add($qb->expr()->isMemberOf(':scope_' . $key, 'ap.scopes')); + $orx->add($qb->expr()->orX( + $qb->expr()->isMemberOf(':scope_' . $key, 'ap.scopes'), + $qb->expr()->eq('ap.user', ':user') + )); $qb->setParameter('scope_' . $key, $scope); + $qb->setParameter('user', $this->security->getUser()); } $qb->andWhere($orx);