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 8b0943ff07..b600bf2132 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit 8b0943ff07aaa585173f8edcbe51215d96a46391 +Subproject commit b600bf2132c02c1929f6d2d24bcff8ca44f93f3d diff --git a/lib/ui-library b/lib/ui-library index eb1e80ebb5..77646d70ca 160000 --- a/lib/ui-library +++ b/lib/ui-library @@ -1 +1 @@ -Subproject commit eb1e80ebb5374296a0975268c5faf5a9fa344c5b +Subproject commit 77646d70ca35533ccace87b4f4556faabd15c9b6