action to create an accompanyinig period

This commit is contained in:
2021-05-19 16:14:36 +02:00
parent 03bd1674e1
commit 25d7fc36a4
5 changed files with 131 additions and 81 deletions

View File

@@ -38,6 +38,9 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRole
}
// TODO take scopes into account
if (count($subject->getPersons()) === 0) {
return true;
}
foreach ($subject->getPersons() as $person) {
// give access as soon as on center is reachable
if ($this->helper->userHasAccess($token->getUser(), $person->getCenter(), $attribute)) {