mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix activity rights (WIP)
This commit is contained in:
@@ -133,7 +133,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
|
||||
// change attribute CREATE
|
||||
if (self::CREATE === $attribute) {
|
||||
$attribute = self::CREATE_PERSON;
|
||||
return $this->voterHelper->voteOnAttribute(self::CREATE_PERSON, null, $token);
|
||||
}
|
||||
} elseif ($subject->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
|
||||
if (!$this->security->isGranted(AccompanyingPeriodVoter::SEE, $subject->getAccompanyingPeriod())) {
|
||||
@@ -144,7 +144,8 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
if (AccompanyingPeriod::STEP_CLOSED === $subject->getAccompanyingPeriod()->getStep()) {
|
||||
return false;
|
||||
}
|
||||
$attribute = self::CREATE_ACCOMPANYING_COURSE;
|
||||
|
||||
return $this->voterHelper->voteOnAttribute(self::CREATE_ACCOMPANYING_COURSE, $subject->getAccompanyingPeriod(), $token);
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException('Could not determine context of activity.');
|
||||
|
Reference in New Issue
Block a user