Fixed: do not allow to create activities when no rights to do it

The ACTIVITY_FULL role does not give anymore the roles
CHILL_ACTIVITY_CREATE_PERSON and CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE.

Tags: #BC
This commit is contained in:
2022-07-11 19:29:45 +02:00
parent ce17c15d41
commit 6998043159
7 changed files with 458 additions and 570 deletions

View File

@@ -159,12 +159,12 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
// transform the attribute
if (self::CREATE === $attribute) {
$attribute = self::CREATE_ACCOMPANYING_COURSE;
return $this->voterHelper->voteOnAttribute(self::CREATE_ACCOMPANYING_COURSE, $subject, $token);
}
} elseif ($subject instanceof Person) {
// transform the attribute
if (self::CREATE === $attribute) {
$attribute = self::CREATE_PERSON;
return $this->voterHelper->voteOnAttribute(self::CREATE_PERSON, $subject, $token);
}
}