diff --git a/controllers/grid/preprintGalleys/PreprintGalleyGridHandler.php b/controllers/grid/preprintGalleys/PreprintGalleyGridHandler.php index 793ca6c5cf..870cd94b49 100644 --- a/controllers/grid/preprintGalleys/PreprintGalleyGridHandler.php +++ b/controllers/grid/preprintGalleys/PreprintGalleyGridHandler.php @@ -488,14 +488,23 @@ public function canEdit() $submission = $this->getSubmission(); $userRoles = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_USER_ROLES); - if ($publication->getData('status') === PKPSubmission::STATUS_PUBLISHED) { - return false; - } - if (in_array(Role::ROLE_ID_SITE_ADMIN, $userRoles)) { return true; } + // if it is published, allow managers or sub-editors + if ($publication->getData('status') === PKPSubmission::STATUS_PUBLISHED) { + // allow these roles to edit galleys even if published + if ( + in_array(Role::ROLE_ID_MANAGER, $userRoles) || + in_array(Role::ROLE_ID_SUB_EDITOR, $userRoles) + ) { + return true; + } + // otherwise block + return false; + } + if ($submission->getData('dateSubmitted') == null) { return true; } @@ -504,7 +513,6 @@ public function canEdit() return true; } - // Default: Read-only. return false; } diff --git a/cypress/tests/data/60-content/CmontgomerieSubmission.cy.js b/cypress/tests/data/60-content/CmontgomerieSubmission.cy.js index 65a3751734..a60851bcf8 100644 --- a/cypress/tests/data/60-content/CmontgomerieSubmission.cy.js +++ b/cypress/tests/data/60-content/CmontgomerieSubmission.cy.js @@ -115,10 +115,9 @@ describe('Data suite: Cmontgomerie', function() { cy.wait(5000); cy.openWorkflowMenu('Permissions & Disclosure'); - cy.get('input[id^="publicationLicense-copyrightHolder-control-en"').clear() - cy.get('input[id^="publicationLicense-copyrightHolder-control-en"').type('Craig Montgomerie', {delay: 0}); + cy.get('input[id^="publicationLicense-copyrightHolder-control-en"').clear(); + cy.get('input[id^="publicationLicense-copyrightHolder-control-en"').type('Craig Montgomerie'); cy.get('button').contains('Save').click(); - cy.get('[role="status"]').contains('Saved'); cy.wait(1500); // Publish 2nd version diff --git a/cypress/tests/integration/Doi.cy.js b/cypress/tests/integration/Doi.cy.js index 24e7048c87..693d8378e8 100644 --- a/cypress/tests/integration/Doi.cy.js +++ b/cypress/tests/integration/Doi.cy.js @@ -320,7 +320,7 @@ describe('DOI tests', function() { cy.get('button:contains("Post")').click(); cy.get('[data-cy="active-modal"] button:contains("Post")').click(); - cy.get('div:contains("This version has been posted and can not be edited.")').should('exist'); + cy.get('div:contains("Warning: This version has been published. Editing it may impact the published content.")').should('exist'); // Confirm DOI created for Version 1 // First publication assigns DOI as normal @@ -365,7 +365,7 @@ describe('DOI tests', function() { cy.get('button:contains("Post")').click(); cy.get('div.pkpWorkflow__publishModal button:contains("Post")').click(); - cy.get('div:contains("This version has been posted and can not be edited.")').should('exist'); + cy.get('div:contains("Warning: This version has been published. Editing it may impact the published content.")').should('exist'); // Confirm DOI carried over from Version 1 to Version 2 cy.visit('index.php/publicknowledge/dois'); @@ -506,7 +506,7 @@ describe('DOI tests', function() { cy.get('button:contains("Post")').click(); cy.get('div.pkpWorkflow__publishModal button:contains("Post")').click(); - cy.get('div:contains("This version has been posted and can not be edited.")').should('exist'); + cy.get('div:contains("Warning: This version has been published. Editing it may impact the published content.")').should('exist'); // Confirm "current publication" DOI is new cy.visit('index.php/publicknowledge/dois'); diff --git a/lib/pkp b/lib/pkp index 6db0ed3e8e..e6a1f045ed 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit 6db0ed3e8e2bb433ad7863b548120c4ccc2bf991 +Subproject commit e6a1f045ed2f1a6de8a7f3ed0d81ab8f782711da diff --git a/lib/ui-library b/lib/ui-library index a73c5835b3..ab6932605c 160000 --- a/lib/ui-library +++ b/lib/ui-library @@ -1 +1 @@ -Subproject commit a73c5835b3c2e3a3816d21dbbf9385aec6d8ba34 +Subproject commit ab6932605cf922eedb3048340d6adac68b3f1a89 diff --git a/locale/en/submission.po b/locale/en/submission.po index 1c0bcb6f90..a9be6d559b 100644 --- a/locale/en/submission.po +++ b/locale/en/submission.po @@ -64,6 +64,9 @@ msgstr "All Items" msgid "galley.editPublishedDisabled" msgstr "The galleys of this version can not be edited because it has already been posted." +msgid "publication.editorEditWarning" +msgstr "Warning: This version has been published. Editing it may impact the published content." + msgid "galley.publicationNotFound" msgstr "The version for this galley could not be found."