-
Notifications
You must be signed in to change notification settings - Fork 452
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#i9963 API Endpoint to download review files #10112
base: main
Are you sure you want to change the base?
Conversation
The implemented endpoint seems to support the use-case described in #9964. Assigned files can be retrieved by sending the appropriate fileStage(4) in the pkp-lib/api/v1/submissions/PKPSubmissionFileController.php Lines 644 to 654 in fe3fe79
|
public function effect() | ||
{ | ||
$user = $this->request->getUser(); | ||
if (!$user instanceof User) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This make sense in theory but doesn't allow for admin access (site admin, journal manager, etc.) or other elevated roles like editors. As a site admin, I would expect all routes to be accessible via the site admin API key. I saw you said you based this on the ReviewAssignmentAccessPolicy
. I think it makes sense to keep this as part of the ReviewAssignmentFileAccessPolicy
as-is but to conditionally apply the policy check like ReviewAssignmentAccessPolicy
is here:
pkp-lib/classes/security/authorization/SubmissionAccessPolicy.php
Lines 74 to 85 in 0434331
// | |
// Reviewer role | |
// | |
if (isset($roleAssignments[Role::ROLE_ID_REVIEWER])) { | |
// 1) Reviewers can access whitelisted operations ... | |
$reviewerSubmissionAccessPolicy = new PolicySet(PolicySet::COMBINING_DENY_OVERRIDES); | |
$reviewerSubmissionAccessPolicy->addPolicy(new RoleBasedHandlerOperationPolicy($request, Role::ROLE_ID_REVIEWER, $roleAssignments[Role::ROLE_ID_REVIEWER])); | |
// 2) ... but only if they have been assigned to the submission as reviewers. | |
$reviewerSubmissionAccessPolicy->addPolicy(new ReviewAssignmentAccessPolicy($request, $permitDeclined)); | |
$submissionAccessPolicy->addPolicy($reviewerSubmissionAccessPolicy); | |
} |
No description provided.