1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-12-11 11:17:53 +01:00

Team member don't have access to other people authorizations

This commit is contained in:
2021-03-28 20:09:29 +02:00
parent 35863c4bda
commit a45d57e51a
2 changed files with 3 additions and 2 deletions

View File

@@ -372,8 +372,7 @@ class TeamAuthorizationsView(LoginRequiredMixin, DetailView):
user = request.user
if not user.is_authenticated:
return super().handle_no_permission()
if user.registration.is_admin or user.registration.participates and user.registration.team.pk == kwargs["pk"] \
or user.registration.is_volunteer \
if user.registration.is_admin or user.registration.is_volunteer \
and self.get_object().participation.tournament in user.registration.interesting_tournaments:
return super().dispatch(request, *args, **kwargs)
raise PermissionDenied