Fix permissions for solutions and syntheses
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
867ee7efe1
commit
a381b5583c
|
@ -800,7 +800,7 @@ class SolutionView(LoginRequiredMixin, View):
|
||||||
or (user.registration.is_volunteer
|
or (user.registration.is_volunteer
|
||||||
and user.registration in solution.tournament.organizers.all())
|
and user.registration in solution.tournament.organizers.all())
|
||||||
or (user.registration.is_volunteer
|
or (user.registration.is_volunteer
|
||||||
and user.registration.presided_pools.filter(tournament=solution.tournament).exists())
|
and user.registration.pools_presided.filter(tournament=solution.tournament).exists())
|
||||||
or user.registration.is_volunteer
|
or user.registration.is_volunteer
|
||||||
and Passage.objects.filter(Q(pool__juries=user.registration)
|
and Passage.objects.filter(Q(pool__juries=user.registration)
|
||||||
| Q(pool__tournament__in=user.registration.organized_tournaments.all()),
|
| Q(pool__tournament__in=user.registration.organized_tournaments.all()),
|
||||||
|
@ -836,7 +836,7 @@ class SynthesisView(LoginRequiredMixin, View):
|
||||||
if not (user.registration.is_admin or user.registration.is_volunteer
|
if not (user.registration.is_admin or user.registration.is_volunteer
|
||||||
and (user.registration in synthesis.passage.pool.juries.all()
|
and (user.registration in synthesis.passage.pool.juries.all()
|
||||||
or user.registration in synthesis.passage.pool.tournament.organizers.all()
|
or user.registration in synthesis.passage.pool.tournament.organizers.all()
|
||||||
or user.registration.presided_pools.filter(tournament=synthesis.passage.pool.tournament).exists())
|
or user.registration.pools_presided.filter(tournament=synthesis.passage.pool.tournament).exists())
|
||||||
or user.registration.participates and user.registration.team == synthesis.participation.team):
|
or user.registration.participates and user.registration.team == synthesis.participation.team):
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
# Guess mime type of the file
|
# Guess mime type of the file
|
||||||
|
|
Loading…
Reference in New Issue