Skip to content

Commit

Permalink
pkp/pkp-lib#5047 Don't allow galleys to be added or edited in publish…
Browse files Browse the repository at this point in the history
…ed publications
  • Loading branch information
NateWr committed Sep 23, 2019
1 parent e60bddc commit df21fa5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions controllers/grid/articleGalleys/ArticleGalleyGridHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function getRowInstance() {
return new ArticleGalleyGridRow(
$this->getSubmission(),
$this->getPublication(),
!empty(array_intersect([ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT], $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES)))
$this->canEdit()
);
}

Expand Down Expand Up @@ -417,12 +417,13 @@ function fetchRow($args, $request) {
* @return boolean
*/
public function canEdit() {
return Services::get('user')->canUserAccessStage(
WORKFLOW_STAGE_ID_PRODUCTION,
WORKFLOW_TYPE_EDITORIAL,
$this->getAuthorizedContextObject(ASSOC_TYPE_ACCESSIBLE_WORKFLOW_STAGES),
$this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES)
);
return $this->getPublication()->getData('status') !== STATUS_PUBLISHED &&
Services::get('user')->canUserAccessStage(
WORKFLOW_STAGE_ID_PRODUCTION,
WORKFLOW_TYPE_EDITORIAL,
$this->getAuthorizedContextObject(ASSOC_TYPE_ACCESSIBLE_WORKFLOW_STAGES),
$this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES)
);
}
}

Expand Down

0 comments on commit df21fa5

Please sign in to comment.