fix: losen constraint to edit assignment

This commit is contained in:
Björn Fromme
2024-01-31 20:10:03 +01:00
parent 2a9e1232ec
commit d2ebb6b70f
+3 -6
View File
@@ -38,12 +38,9 @@ class AssignmentVoter extends Voter
return true;
}
// Only users with administrative role may edit assignments without applications or dispositions
if (static::EDIT === $attribute && in_array('ROLE_ADMINISTRATIVE', $token->getRoleNames())) {
$assignmentCount = $assignment->getApplications()->count();
$dispositionCount = $assignment->getDispositions()->count();
return 0 === $assignmentCount && 0 === $dispositionCount;
// Only users with administrative role may edit assignments
if (static::EDIT === $attribute) {
return in_array('ROLE_ADMINISTRATIVE', $token->getRoleNames());
}
// Only allow applications to open assignments