FIX [delete][parcours] delete right removed from voter.

This commit is contained in:
Julie Lenaerts 2023-02-13 17:51:46 +01:00
parent 9465f26f09
commit 860d14e082
2 changed files with 3 additions and 12 deletions

View File

@ -973,14 +973,14 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
// accompanying period // accompanying period
AccompanyingPeriodVoter::SEE_DETAILS => [AccompanyingPeriodVoter::SEE], AccompanyingPeriodVoter::SEE_DETAILS => [AccompanyingPeriodVoter::SEE],
AccompanyingPeriodVoter::CREATE => [AccompanyingPeriodVoter::SEE_DETAILS], AccompanyingPeriodVoter::CREATE => [AccompanyingPeriodVoter::SEE_DETAILS],
AccompanyingPeriodVoter::DELETE => [AccompanyingPeriodVoter::SEE_DETAILS], // AccompanyingPeriodVoter::DELETE => [AccompanyingPeriodVoter::SEE_DETAILS],
AccompanyingPeriodVoter::EDIT => [AccompanyingPeriodVoter::SEE_DETAILS], AccompanyingPeriodVoter::EDIT => [AccompanyingPeriodVoter::SEE_DETAILS],
// give all ACL for FULL // give all ACL for FULL
AccompanyingPeriodVoter::FULL => [ AccompanyingPeriodVoter::FULL => [
AccompanyingPeriodVoter::SEE_DETAILS, AccompanyingPeriodVoter::SEE_DETAILS,
AccompanyingPeriodVoter::CREATE, AccompanyingPeriodVoter::CREATE,
AccompanyingPeriodVoter::EDIT, AccompanyingPeriodVoter::EDIT,
AccompanyingPeriodVoter::DELETE, // AccompanyingPeriodVoter::DELETE,
], ],
AccompanyingPeriodVoter::REASSIGN_BULK => [ AccompanyingPeriodVoter::REASSIGN_BULK => [
AccompanyingPeriodVoter::CONFIDENTIAL_CRUD, AccompanyingPeriodVoter::CONFIDENTIAL_CRUD,

View File

@ -34,7 +34,6 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
self::SEE_DETAILS, self::SEE_DETAILS,
self::CREATE, self::CREATE,
self::EDIT, self::EDIT,
self::DELETE,
self::FULL, self::FULL,
self::TOGGLE_CONFIDENTIAL_ALL, self::TOGGLE_CONFIDENTIAL_ALL,
self::TOGGLE_INTENSITY, self::TOGGLE_INTENSITY,
@ -48,13 +47,6 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE'; public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE';
/**
* role to DELETE the course.
*
* Will be true only for the creator, and if the course is still at DRAFT step.
*/
public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE';
/** /**
* role to EDIT the course. * role to EDIT the course.
* *
@ -132,7 +124,6 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
self::CONFIDENTIAL_CRUD, self::CONFIDENTIAL_CRUD,
self::CREATE, self::CREATE,
self::EDIT, self::EDIT,
self::DELETE,
self::FULL, self::FULL,
self::TOGGLE_CONFIDENTIAL_ALL, self::TOGGLE_CONFIDENTIAL_ALL,
self::REASSIGN_BULK, self::REASSIGN_BULK,
@ -163,7 +154,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
if ($subject instanceof AccompanyingPeriod) { if ($subject instanceof AccompanyingPeriod) {
if (AccompanyingPeriod::STEP_CLOSED === $subject->getStep()) { if (AccompanyingPeriod::STEP_CLOSED === $subject->getStep()) {
if (in_array($attribute, [self::EDIT, self::DELETE], true)) { if (in_array($attribute, [self::EDIT], true)) {
return false; return false;
} }