mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Corrections voter + entity property intensity, not emergency
This commit is contained in:
@@ -33,7 +33,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
self::DELETE,
|
||||
self::FULL,
|
||||
self::TOGGLE_CONFIDENTIAL_ALL,
|
||||
self::TOGGLE_URGENCY
|
||||
self::TOGGLE_INTENSITY
|
||||
];
|
||||
|
||||
public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE';
|
||||
@@ -66,7 +66,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
* Right to toggle urgency of parcours.
|
||||
*/
|
||||
|
||||
public const TOGGLE_URGENCY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_URGENCY';
|
||||
public const TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY';
|
||||
|
||||
private Security $security;
|
||||
|
||||
@@ -138,12 +138,12 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
return $this->voterHelper->voteOnAttribute(self::TOGGLE_CONFIDENTIAL_ALL, $subject, $token);
|
||||
}
|
||||
|
||||
if (self::TOGGLE_URGENCY === $attribute) {
|
||||
if (self::TOGGLE_INTENSITY === $attribute) {
|
||||
if ($subject->getUser() === $token->getUser()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->voterHelper->voteOnAttribute(self::TOGGLE_CONFIDENTIAL_ALL, $subject, $token);
|
||||
return false;
|
||||
}
|
||||
|
||||
// if confidential, only the referent can see it
|
||||
|
Reference in New Issue
Block a user