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

Ambiguous error message for unauthorized prepublication access #50

Closed
ewhanson opened this issue Jul 23, 2024 · 1 comment
Closed

Ambiguous error message for unauthorized prepublication access #50

ewhanson opened this issue Jul 23, 2024 · 1 comment
Assignees

Comments

@ewhanson
Copy link
Collaborator

If an authenticated user/API key is required for access and the request is not authorized, the message returned via OAI is the same as when no JATS is found (Cannot disseminate format (JATS XML not available)), see:

$subscriptionRequired = $issueAction->subscriptionRequired($issue, $journal);
$isSubscribedDomain = $issueAction->subscribedDomain(Application::get()->getRequest(), $journal, $issue->getId(), $article->getId());
$allowedPrePublicationAccess = $issueAction->allowedIssuePrePublicationAccess($journal, $request->getUser());
if ($subscriptionRequired && (!$allowedPrePublicationAccess && !$isSubscribedDomain)) {
$oaiDao->oai->error('cannotDisseminateFormat', 'Cannot disseminate format (JATS XML not available)');
exit();
}

This should return a distinct message, indicating the type of error (why it cannot disseminate format)—that the record requires the request to include an authenticated user or API key with the correct access permissions.

This causes difficulties for downstream consumers of the OAI JATS metadata because it is not clear why OJS is failing to return the expected JATS XML.

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

No branches or pull requests

1 participant