Details
Description
Uploading package with API does not work.
Steps to reproduce:
```
curl -v \
--form contest_id=contest-id\
--form round_name=round-name \
--form package_file=@/path/to/file/abc.zip \
--header 'Authorization: Token XXX-XXX-XXX-XXX' \
https://sio2.mimuw.edu.pl/api/problems/package_upload/
```
Error code: 403
Returned JSON: `{"message":"Permission denied."}`
Tested on SIO and Szkopuł by different users with permissions.
PS (to person fixing)
It would be nice, if uploading packed would return problem_id needed by package_reupload, if that doesn't now.
Steps to reproduce:
```
curl -v \
--form contest_id=contest-id\
--form round_name=round-name \
--form package_file=@/path/to/file/abc.zip \
--header 'Authorization: Token XXX-XXX-XXX-XXX' \
https://sio2.mimuw.edu.pl/api/problems/package_upload/
```
Error code: 403
Returned JSON: `{"message":"Permission denied."}`
Tested on SIO and Szkopuł by different users with permissions.
PS (to person fixing)
It would be nice, if uploading packed would return problem_id needed by package_reupload, if that doesn't now.
Activity
Szymon Acedański
made changes -
Field | Original Value | New Value |
---|---|---|
Labels | tag1 | |
Priority | Major [ 3 ] | Minor [ 4 ] |
Dominik Klemba
made changes -
Component/s | OIOIOI [ 10220 ] | |
Component/s | SIO2 Project Website and Infrastructure [ 10090 ] |
Wojciech Dubiel
made changes -
Status | New [ 10000 ] | Resolved [ 5 ] |
Assignee | Szymon Acedański [ accek ] | |
Resolution | Fixed [ 1 ] |
Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
---|---|---|---|---|---|---|---|---|---|
|
4d 15h 46m | 1 | Wojciech Dubiel | 2020-04-10 9:49 |
https://github.com/sio2project/oioioi/blob/549df58b09d9699327bb5808e2ce3e30b0a4a616/oioioi/problems/api.py#L32
The is_contest_admin check does not use the passed contest.
If this is a good guess, then superadmins should be able to upload packages.