mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
viewing permission checked for returned accompanying periods by-person
This commit is contained in:
parent
902c45f0cd
commit
8d947ea81b
@ -207,7 +207,11 @@ $workflow = $this->registry->get($accompanyingPeriod);
|
||||
*/
|
||||
public function getAccompanyingPeriodsByPerson(Person $person){
|
||||
$accompanyingPeriods = $person->getAccompanyingPeriods();
|
||||
return $this->json(\array_values($accompanyingPeriods), Response::HTTP_OK, [], ['groups' => [ 'read']]);
|
||||
$accompanyingPeriodsChecked = array_filter($accompanyingPeriods,
|
||||
function(AccompanyingPeriod $period){
|
||||
return $this->isGranted(AccompanyingPeriodVoter::SEE, $period);
|
||||
});
|
||||
return $this->json(\array_values($accompanyingPeriodsChecked), Response::HTTP_OK, [], ['groups' => [ 'read']]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user