Skip to content

Tasks API - let competition organizers update a task used by their competition - #2670

Merged
Didayolo merged 3 commits into
developfrom
task-update-collaborators
Oct 21, 2026
Merged

Didayolo merged 3 commits into
developfrom
task-update-collaborators

Conversation

@Didayolo

@Didayolo Didayolo commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Original PR #2649

Description

Follows @Didayolo's comment on #2624: the common reason a phase task gets replaced is that a co-organizer cannot edit a task created by the challenge owner. Replacing detaches every existing score (n/a on the leaderboard) and usually ends with the old task being deleted.

TaskViewSet.update only allowed the creator or a superuser. This PR also allows:

  • users the task is shared_with
  • organizers (creator or collaborators) of a competition whose phase uses the task

so the task can be fixed in place: same task id, existing scores stay comparable, re-run keeps working. Deletion stays creator-only (it is irreversible; see #2648).

Together with #2642 (flag outdated scores), #2644 (resubmit on current tasks) and #2648 (refuse to delete a task with submissions), this removes the need to change re-run semantics as in #2624.

Issues this PR resolves

A checklist for hand testing

  • As user A, create a task and a competition using it; add user B as collaborator
  • As user B, open the task and change its scoring program (or name): the update is accepted
  • As a user who is neither creator, shared-with, nor organizer: the update is refused (403)
  • As user B, deleting the task is still refused

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 Didayolo self-assigned this Oct 20, 2026
…mpetition

Only the task creator (or a superuser) could edit a task. A co-organizer who
needs to fix the scoring program or a dataset therefore has to upload a new
task and replace the old one in the phase, which detaches every existing
score (shown as n/a) and leads to deleting the old task. Allow users the
task is shared with and organizers of a competition that uses the task to
update it in place. Deleting stays creator-only.
@Didayolo
Didayolo force-pushed the task-update-collaborators branch from a74e8e1 to 3e35173 Compare October 21, 2026 02:28
@Didayolo

Didayolo commented Oct 21, 2026 •

Copy link
Copy Markdown
Member Author

I fixed some points, and importantly I changed the rule that gives permission to edit a task:

Now you can edit a task only if you are co-organizer of a competition that was created by the task creator.

Otherwise an attacker can find ways to edit public tasks, or even private tasks by adding anyone as a co-organizer of their own competition.

@Didayolo

Copy link
Copy Markdown
Member Author

I also updated the UI, so the tasks that you can edit are shown in your "Resources" menu. Added a checkbox "Show Co-organized Tasks".

Capture d’écran 2026-10-21 à 04 56 20

@Didayolo
Didayolo merged commit 9dbfd8a into develop Oct 21, 2026
3 checks passed
@Didayolo
Didayolo deleted the task-update-collaborators branch October 21, 2026 03:11
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.

2 participants