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

[FEATURE] Django/DMOJ-like permissions #222

Open
4 of 7 tasks
jdabtieu opened this issue Jul 5, 2023 · 1 comment
Open
4 of 7 tasks

[FEATURE] Django/DMOJ-like permissions #222

jdabtieu opened this issue Jul 5, 2023 · 1 comment
Assignees
Labels
priority low Nice-to-have, but not required
Milestone

Comments

@jdabtieu
Copy link
Owner

jdabtieu commented Jul 5, 2023

Currently, CTFOJ only supports three permission levels: user, admin, and superadmin. Superadmin is hard-coded as the user with ID 1, so really there are only two permission levels that can be set. We also should have problems manager (can add/edit/delete problems but without full admin interface), perms for individual contests/problems, etc.

  • Shift permissions to a new table of [user_id, permission_id]
  • Remove the current admin flag
  • Add permission enums (SUPER_ADMIN, ADMIN, PROBLEM_MANAGER)
  • Add a problem_authors table mapping [problem_id, contest_id (optional), user_id] to set problem authors, which also implicitly gives authors perms to their own problems and displays authors on the problem page
  • Add a contest_admins table mapping [contest_id, user_id] to give contest admins effective admin perms for their own contests
  • Add a content manager role with permissions to manage pages, contests, problems, but not users
  • Permission inheritance?
@jdabtieu jdabtieu added the priority normal Important, but not urgent label Jul 5, 2023
@jdabtieu jdabtieu self-assigned this Jul 5, 2023
@jdabtieu jdabtieu changed the title [FEATURE] Django-like permissions [FEATURE] Django/DMOJ-like permissions Jul 5, 2023
@jdabtieu jdabtieu mentioned this issue Jul 7, 2023
@jdabtieu jdabtieu added priority low Nice-to-have, but not required and removed priority normal Important, but not urgent labels Aug 5, 2023
@jdabtieu jdabtieu modified the milestones: v4.3.0, v4.2.0 Nov 20, 2023
@jdabtieu
Copy link
Owner Author

Content manager role to be added in 4.2.0, other tasks are still scheduled for 4.3.0

jdabtieu added a commit that referenced this issue Nov 27, 2023
This role can edit all content, but not users, on the site.
#222
@jdabtieu jdabtieu modified the milestones: v4.2.0, v4.3.0, v4.4.0 Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority low Nice-to-have, but not required
Projects
None yet
Development

No branches or pull requests

1 participant