mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'bugfix/accompanying-period-filter-list-by-person-using-acl' into 'master'
List for accompanying course for a person: filter using acl See merge request Chill-Projet/chill-bundles!235
This commit is contained in:
commit
8a0d16dc53
@ -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)
|
||||
* [activity] remove the "plus" button in activity list
|
||||
* [activity] check ACL on activity list in person context
|
||||
* [list for accompanying course in person] filter list using ACL
|
||||
|
||||
## Test releases
|
||||
|
||||
|
@ -213,9 +213,14 @@ class AccompanyingPeriodController extends AbstractController
|
||||
]);
|
||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||
|
||||
$accompanyingPeriods = $this->accompanyingPeriodACLAwareRepository
|
||||
$accompanyingPeriodsRaw = $this->accompanyingPeriodACLAwareRepository
|
||||
->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', [
|
||||
'accompanying_periods' => $accompanyingPeriods,
|
||||
'person' => $person,
|
||||
|
Loading…
x
Reference in New Issue
Block a user