Skip to content

Commit c7dab01

Browse files
committed
pkp/pkp-lib#10263 Prevent authors from editing publication metadata even if granted permission by editor
1 parent af28ea4 commit c7dab01

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/pages/workflow/composables/useWorkflowPermissions.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ export function useWorkflowPermissions({submission, selectedPublication}) {
4949
});
5050

5151
canEditPublication = submission.value.canCurrentUserChangeMetadata;
52+
const isAuthor = hasIntersection(activeStage.currentUserAssignedRoles, [
53+
pkp.const.ROLE_ID_AUTHOR,
54+
]);
55+
const pub = selectedPublication.value
56+
? selectedPublication.value
57+
: submission.value.currentPublication;
58+
59+
if (isAuthor && pub?.status === pkp.const.STATUS_PUBLISHED) {
60+
canEditPublication = false;
61+
}
5262

5363
if (
5464
hasIntersection(activeStage.currentUserAssignedRoles, [...EditorialRoles])

0 commit comments

Comments
 (0)