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

This commit is contained in:
Julie Lenaerts 2023-01-31 14:38:51 +01:00
parent 9ffe1ff8a8
commit 56a17a0bcd

View File

@ -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);