Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#10076 show declined/cancelled reviews to editors #10847

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hafsa-Naeem
Copy link
Contributor

for #10076

Copy link
Collaborator

@Vitaliy-1 Vitaliy-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've added a comment regarding global roles and assignment roles.

// is the user a manager, sub-editor, or site admin?
$canSeeAllReviewAssignments = (
in_array(Role::ROLE_ID_MANAGER, $currentUserRoleIds) ||
in_array(Role::ROLE_ID_SUB_EDITOR, $currentUserRoleIds) ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't include here submission editors not assigned to the submission. And probably managers and admins assigned into the submission in the author role or reviewer role. Or assigned to the other stage than the review.

We already calculated roles in the stages property:

"currentUserAssignedRoles": {

Using it you can actually check if the user has those roles, it includes global ones and those related to the assignment.

And also you can use array_intersect() instead of in_array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants