Juries can't download ZIP archives with authorizations

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2023-04-09 11:32:26 +02:00
parent 9734b51f53
commit b40dce27df
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 9 additions and 7 deletions

View File

@ -115,11 +115,13 @@
</dl>
{% if user.registration.is_volunteer %}
<div class="text-center">
<a class="btn btn-info" href="{% url "participation:team_authorizations" pk=team.pk %}">
<i class="fas fa-file-archive"></i> {% trans "Download all submitted authorizations" %}
</a>
</div>
{% if user.registration in self.team.participation.tournament.organizers or user.registration.is_admin %}
<div class="text-center">
<a class="btn btn-info" href="{% url "participation:team_authorizations" pk=team.pk %}">
<i class="fas fa-file-archive"></i> {% trans "Download all submitted authorizations" %}
</a>
</div>
{% endif %}
{% endif %}
</div>
<div class="card-footer text-center">

View File

@ -392,9 +392,9 @@ class TeamAuthorizationsView(LoginRequiredMixin, DetailView):
if not user.is_authenticated:
return super().handle_no_permission()
if user.registration.is_admin or user.registration.is_volunteer \
and (self.get_object().participation.tournament in user.registration.interesting_tournaments
and (user.registration in self.get_object().participation.tournament.organizers
or self.get_object().participation.final
and Tournament.final_tournament() in user.registration.interesting_tournaments):
and user.registration in Tournament.final_tournament().organizers):
return super().dispatch(request, *args, **kwargs)
raise PermissionDenied