Skip to content

Commit efb3999

Browse files
authored
Merge pull request #11386 from Hafsa-Naeem/i10263-stable_3_5_0-cleanup
#10263 Follow-up to clean up canEditPublication method per review feedback from PR#11225
2 parents 0ef666c + 2c49f5b commit efb3999

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

classes/submission/Repository.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,16 +520,16 @@ public function canEditPublication(int $submissionId, int $userId): bool
520520

521521
$submission = $this->get($submissionId);
522522
// any published or scheduled then probe
523-
$hasLockedPublication = $submission
524-
&& $submission->getData('publications')
525-
->contains(fn($p) =>
523+
$hasLockedPublication = $submission?->getData('publications')
524+
->contains(
525+
fn (Publication $p) =>
526526
in_array(
527527
$p->getData('status'),
528528
[Submission::STATUS_PUBLISHED, Submission::STATUS_SCHEDULED]
529529
)
530-
);
530+
);
531531

532-
if ($hasLockedPublication && !$assignments->contains(fn($sa) => $sa->userGroup && $sa->userGroup->roleId !== Role::ROLE_ID_AUTHOR)) {
532+
if ($hasLockedPublication && !$assignments->contains(fn (StageAssignment $sa) => $sa->userGroup && $sa->userGroup->roleId != Role::ROLE_ID_AUTHOR)) {
533533
return false;
534534
}
535535

0 commit comments

Comments
 (0)