mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Corrections voter + entity property intensity, not emergency
This commit is contained in:
parent
7aad5be29f
commit
05e9f118d7
@ -183,7 +183,7 @@ class AccompanyingPeriod implements
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default": false})
|
||||
* @Groups({"read", "docgen:read"})
|
||||
* @Groups({"read", "write", "docgen:read"})
|
||||
*/
|
||||
private bool $emergency = false;
|
||||
|
||||
@ -198,7 +198,7 @@ class AccompanyingPeriod implements
|
||||
/**
|
||||
* @var string
|
||||
* @ORM\Column(type="string", nullable=true)
|
||||
* @Groups({"read", "write"})
|
||||
* @Groups({"read"})
|
||||
* @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CONFIRMED})
|
||||
*/
|
||||
private $intensity = self::INTENSITY_OCCASIONAL;
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user