Skip to content

Conversation

@Didayolo
Copy link
Member

@Didayolo Didayolo commented Apr 22, 2025

Description

Adding permissions to avoid that any user can bulk download any submissions using the API.

Issues this PR resolves

A checklist for hand testing

Access the following URL:

http://localhost/api/submissions/download_many/?pks=["3", "12"]

Replace ["3", "12"] by a list with different submissions ID.

Check that the download works only if you are allowed to download all submissions, otherwise you should have a relevant error message ("You need to be logged in", "You are not allowed to download", etc.)

You should be able to download a submission only if:

  • You are the owner of the submission
  • You are the competition organizer of the competition that received the submission
  • You are super-user of the platform

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

@Didayolo
Copy link
Member Author

Post-it: need to check also the bulk download from "Submissions" organizer interface

@ObadaS
Copy link
Collaborator

ObadaS commented Apr 23, 2025

I have tested it locally and everything is working correctly.
I tested as Site Admin, Organizer and a normal User. I do get error messages when I try to download submissions that I do not have access to when I am an Organizer or a normal user.

@Didayolo Didayolo merged commit 78f5a76 into develop Apr 23, 2025
1 check passed
@Didayolo Didayolo deleted the fix-download-permission branch April 23, 2025 16:02
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.

Anyone can download others’ submissions without any permission checks

3 participants