Skip to content

Commit 4d661a1

Browse files
committed
pkp/pkp-lib#10263 ensure inclusion of ROLE_ID_ASSISTANT in grid handler
1 parent ad7ff58 commit 4d661a1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

controllers/grid/users/chapter/ChapterGridHandler.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,10 @@ public function initialize($request, $args = null)
138138

139139
if ($this->getPublication()->getData('status') === PKPSubmission::STATUS_PUBLISHED) {
140140
$userRoles = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_USER_ROLES);
141-
if (
142-
!in_array(Role::ROLE_ID_SITE_ADMIN, $userRoles)
143-
&& !in_array(Role::ROLE_ID_MANAGER, $userRoles)
144-
&& !in_array(Role::ROLE_ID_SUB_EDITOR, $userRoles)
145-
) {
141+
if (!array_intersect(
142+
[Role::ROLE_ID_SITE_ADMIN, Role::ROLE_ID_MANAGER, Role::ROLE_ID_SUB_EDITOR, Role::ROLE_ID_ASSISTANT],
143+
$userRoles
144+
)) {
146145
// set readOnly to true for everyone else
147146
$this->setReadOnly(true);
148147
}
@@ -247,10 +246,10 @@ public function canAdminister($user)
247246
// if it is published, allow managers or sub-editors
248247
if ($publication->getData('status') === PKPSubmission::STATUS_PUBLISHED) {
249248
// allow these roles to edit galleys even if published
250-
if (
251-
in_array(Role::ROLE_ID_MANAGER, $userRoles) ||
252-
in_array(Role::ROLE_ID_SUB_EDITOR, $userRoles)
253-
) {
249+
if (array_intersect(
250+
[Role::ROLE_ID_MANAGER, Role::ROLE_ID_SUB_EDITOR, Role::ROLE_ID_ASSISTANT],
251+
$userRoles
252+
)) {
254253
return true;
255254
}
256255
// otherwise block

0 commit comments

Comments
 (0)