sio2project / oioioi

GNU General Public License v3.0
160 stars 70 forks source link

Fix TeacherAuthBackend #381

Closed MasloMaslane closed 1 month ago

MasloMaslane commented 1 month ago

The PR that introduced Contest owner permission (#257) changed the can_admin_contest function to this: https://github.com/sio2project/oioioi/blob/288ecffffd14d83020d9b3a7e541f356b2087a66/oioioi/contests/utils.py#L458-L460

Previously, the function also checked for the contests.contest_admin permission. The TeacherAuthBackend was invalid, because it only checked for contests.contest_admin permission and not for the contests.contest_basicadmin permission, which is a subset of contest_admin permission. This resulted in teachers not being able to see their contests