fix: losen constraint to edit assignment
This commit is contained in:
@@ -38,12 +38,9 @@ class AssignmentVoter extends Voter
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only users with administrative role may edit assignments without applications or dispositions
|
// Only users with administrative role may edit assignments
|
||||||
if (static::EDIT === $attribute && in_array('ROLE_ADMINISTRATIVE', $token->getRoleNames())) {
|
if (static::EDIT === $attribute) {
|
||||||
$assignmentCount = $assignment->getApplications()->count();
|
return in_array('ROLE_ADMINISTRATIVE', $token->getRoleNames());
|
||||||
$dispositionCount = $assignment->getDispositions()->count();
|
|
||||||
|
|
||||||
return 0 === $assignmentCount && 0 === $dispositionCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only allow applications to open assignments
|
// Only allow applications to open assignments
|
||||||
|
|||||||
Reference in New Issue
Block a user