mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix access denied when updating a work
This commit is contained in:
parent
e7d0c1cac6
commit
62c78e650f
@ -58,6 +58,11 @@ class AccompanyingPeriodWorkVoter extends Voter
|
|||||||
case self::SEE:
|
case self::SEE:
|
||||||
return $this->security->isGranted(AccompanyingPeriodVoter::SEE_DETAILS, $subject->getAccompanyingPeriod());
|
return $this->security->isGranted(AccompanyingPeriodVoter::SEE_DETAILS, $subject->getAccompanyingPeriod());
|
||||||
|
|
||||||
|
case self::CREATE:
|
||||||
|
case self::UPDATE:
|
||||||
|
return $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod());
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new UnexpectedValueException("attribute {$attribute} is not supported");
|
throw new UnexpectedValueException("attribute {$attribute} is not supported");
|
||||||
}
|
}
|
||||||
@ -79,6 +84,6 @@ class AccompanyingPeriodWorkVoter extends Voter
|
|||||||
|
|
||||||
private function getRoles(): array
|
private function getRoles(): array
|
||||||
{
|
{
|
||||||
return [self::SEE];
|
return [self::SEE, self::CREATE, self::UPDATE];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user