Merge remote-tracking branch 'origin/master' into issue442_toggle_emergency

This commit is contained in:
2022-02-14 13:40:23 +01:00
82 changed files with 1174 additions and 589 deletions

View File

@@ -58,6 +58,11 @@ class AccompanyingPeriodWorkVoter extends Voter
case self::SEE:
return $this->security->isGranted(AccompanyingPeriodVoter::SEE_DETAILS, $subject->getAccompanyingPeriod());
case self::CREATE:
case self::UPDATE:
return $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod());
default:
throw new UnexpectedValueException("attribute {$attribute} is not supported");
}
@@ -66,6 +71,9 @@ class AccompanyingPeriodWorkVoter extends Voter
case self::SEE:
return $this->security->isGranted(AccompanyingPeriodVoter::SEE_DETAILS, $subject);
case self::CREATE:
return $this->security->isGranted(AccompanyingPeriodVoter::CREATE, $subject);
default:
throw new UnexpectedValueException(sprintf(
"attribute {$attribute} is not supported on instance %s",
@@ -79,6 +87,6 @@ class AccompanyingPeriodWorkVoter extends Voter
private function getRoles(): array
{
return [self::SEE];
return [self::SEE, self::CREATE, self::UPDATE];
}
}