From a7f75e254ac6fb4454b236d730e63a3c966cc889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Trembeck=C3=BD?= Date: Sat, 21 Dec 2024 15:31:38 +0100 Subject: [PATCH] mypermissions: propagate `is_superuser` to response (#492) --- personal/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/personal/views.py b/personal/views.py index 9c5e193..4b57a14 100644 --- a/personal/views.py +++ b/personal/views.py @@ -75,11 +75,13 @@ def myprofile(self, request): @action(methods=['get'], detail=False, permission_classes=[IsAuthenticated]) def mypermissions(self, request): is_staff = request.user.is_staff + is_superuser = request.user.is_superuser competition_set = set() for group in request.user.groups.all(): for competition in group.competition_permissions.all(): competition_set.add(competition.pk) return Response({ 'is_staff': is_staff, + 'is_superuser': is_superuser, 'competition_permissions': competition_set, }, status=status.HTTP_200_OK)