Skip to content

Commit

Permalink
🐛(backend) default permission
Browse files Browse the repository at this point in the history
DRF verson 3.15 Fix Respect can_read_model permission in DjangoModelPermissions.
encode/django-rest-framework#8009
  • Loading branch information
kernicPanel committed Mar 18, 2024
1 parent d454905 commit 4cb8892
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/backend/joanie/core/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ class OrganizationViewSet(viewsets.ModelViewSet):
queryset = models.Organization.objects.all()
filterset_class = filters.OrganizationAdminFilterSet

def get_permissions(self):
"""
Instantiates and returns the list of permissions that this view requires.
"""
if self.action in ["list", "retrieve"]:
return [permissions.IsAdminUser()]
return super().get_permissions()

def get_serializer_class(self):
"""
Return the serializer class to use depending on the action.
Expand Down

0 comments on commit 4cb8892

Please sign in to comment.