Feature: an activity has the same scope as an accompanying period, if it exists

This commit is contained in:
2022-07-11 17:36:59 +02:00
parent 3785e5096e
commit 93560a62ef
2 changed files with 16 additions and 3 deletions

View File

@@ -133,7 +133,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
// change attribute CREATE
if (self::CREATE === $attribute) {
return $this->voterHelper->voteOnAttribute(self::CREATE_PERSON, null, $token);
return $this->voterHelper->voteOnAttribute(self::CREATE_PERSON, $subject->getPerson(), $token);
}
} elseif ($subject->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
if (!$this->security->isGranted(AccompanyingPeriodVoter::SEE, $subject->getAccompanyingPeriod())) {