From e732e19021cd8fd6f8c75f29a5587e5b4ac9cd2c Mon Sep 17 00:00:00 2001 From: rtrembecky Date: Sat, 21 Dec 2024 15:29:08 +0100 Subject: [PATCH] mypermissions: propagate `is_superuser` to response --- 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)