mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
List for accompanying course for a person: filter using acl
This commit is contained in:
parent
05385509ef
commit
551486b5ea
@ -16,6 +16,7 @@ and this project adheres to
|
|||||||
* [thirdparty] link from modal to thirdparty detail page fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/228)
|
* [thirdparty] link from modal to thirdparty detail page fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/228)
|
||||||
* [activity] remove the "plus" button in activity list
|
* [activity] remove the "plus" button in activity list
|
||||||
* [activity] check ACL on activity list in person context
|
* [activity] check ACL on activity list in person context
|
||||||
|
* [list for accompanying course in person] filter list using ACL
|
||||||
|
|
||||||
## Test releases
|
## Test releases
|
||||||
|
|
||||||
|
@ -213,9 +213,14 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
|
|
||||||
$accompanyingPeriods = $this->accompanyingPeriodACLAwareRepository
|
$accompanyingPeriodsRaw = $this->accompanyingPeriodACLAwareRepository
|
||||||
->findByPerson($person, AccompanyingPeriodVoter::SEE);
|
->findByPerson($person, AccompanyingPeriodVoter::SEE);
|
||||||
|
|
||||||
|
// filter visible or not visible
|
||||||
|
$accompanyingPeriods = array_filter($accompanyingPeriodsRaw, function (AccompanyingPeriod $ap) {
|
||||||
|
return $this->isGranted(AccompanyingPeriodVoter::SEE, $ap);
|
||||||
|
});
|
||||||
|
|
||||||
return $this->render('@ChillPerson/AccompanyingPeriod/list.html.twig', [
|
return $this->render('@ChillPerson/AccompanyingPeriod/list.html.twig', [
|
||||||
'accompanying_periods' => $accompanyingPeriods,
|
'accompanying_periods' => $accompanyingPeriods,
|
||||||
'person' => $person,
|
'person' => $person,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user