Skip to content

Commit 77646d7

Browse files
committed
pkp/pkp-lib#10263 block authors from editing any version if a submission has a published or scheduled publication
1 parent 7d92215 commit 77646d7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/pages/workflow/composables/useWorkflowPermissions.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ export function useWorkflowPermissions({submission, selectedPublication}) {
5252
const isAuthor = hasIntersection(activeStage.currentUserAssignedRoles, [
5353
pkp.const.ROLE_ID_AUTHOR,
5454
]);
55-
const pub = selectedPublication.value
56-
? selectedPublication.value
57-
: submission.value.currentPublication;
58-
59-
if (isAuthor && pub?.status === pkp.const.STATUS_PUBLISHED) {
55+
// block authors from editing any version if there is a published or scheduled version
56+
const hasBlockedPublication = submission.value.publications.some((p) =>
57+
[pkp.const.STATUS_PUBLISHED, pkp.const.STATUS_SCHEDULED].includes(
58+
p.status,
59+
),
60+
);
61+
if (isAuthor && hasBlockedPublication) {
6062
canEditPublication = false;
6163
}
6264

0 commit comments

Comments
 (0)