Skip to content

Commit

Permalink
fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Viesich committed Nov 11, 2024
1 parent bdb9ff4 commit 21a6fd6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cinema/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@
class GenreViewSet(viewsets.ModelViewSet):
queryset = Genre.objects.all()
serializer_class = GenreSerializer
permission_classes = (IsAdminOrIfAuthenticatedReadOnly, )
permission_classes = (IsAdminUser(), )

def get_permissions(self):
if self.action in ("list", "create"):
return (IsAdminOrIfAuthenticatedReadOnly(), )
else:
return (IsAdminUser(), )


class ActorViewSet(viewsets.ModelViewSet):
Expand Down

0 comments on commit 21a6fd6

Please sign in to comment.