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

records: problem uploading to new Sandbox record from hepdata-cli for non-admin user #735

Closed
GraemeWatt opened this issue Nov 29, 2023 · 0 comments
Assignees
Labels
complexity: low priority: high type: bug Indicates an unexpected problem or unintended behaviour

Comments

@GraemeWatt
Copy link
Member

GraemeWatt commented Nov 29, 2023

If a non-admin user tries to upload to a new Sandbox record using the hepdata-cli upload they get an error message:

HTTPError: 403 Client Error: FORBIDDEN for url: https://www.hepdata.net/record/cli_upload
Reason: Email <email> does not correspond to a confirmed uploader for this record.

This seems to be a bug introduced in PR #329. The check:

# Check the user has upload permissions for this record
if not has_upload_permissions(recid, user, is_sandbox):
return jsonify({
"message": "Email {} does not correspond to a confirmed uploader for this record.".format(str(user_email))
}), 403

should not be made for a new Sandbox record (recid=None).

Thanks to Louie Corpe (@ldcorpe) for reporting this bug.

@GraemeWatt GraemeWatt added type: bug Indicates an unexpected problem or unintended behaviour priority: high complexity: low labels Nov 29, 2023
@GraemeWatt GraemeWatt self-assigned this Nov 29, 2023
@github-project-automation github-project-automation bot moved this to To do in @HEPData Nov 29, 2023
@github-project-automation github-project-automation bot moved this from To do to Done in @HEPData Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: low priority: high type: bug Indicates an unexpected problem or unintended behaviour
Projects
Status: Done
Development

No branches or pull requests

1 participant