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