Limit card actions only to admins

This commit is contained in:
Tanner Collin 2020-02-27 22:34:34 +00:00
parent e46b7fab01
commit ecefa479ee

View File

@ -141,7 +141,7 @@ class MemberViewSet(Base, Retrieve, Update):
class CardViewSet(Base, Create, Retrieve, Update, Destroy): class CardViewSet(Base, Create, Retrieve, Update, Destroy):
permission_classes = [AllowMetadata | IsAuthenticated, IsObjOwnerOrAdmin] permission_classes = [AllowMetadata | IsAuthenticated, IsAdmin]
queryset = models.Card.objects.all() queryset = models.Card.objects.all()
serializer_class = serializers.CardSerializer serializer_class = serializers.CardSerializer
@ -417,7 +417,7 @@ class PasteView(views.APIView):
class HistoryViewSet(Base, List, Retrieve): class HistoryViewSet(Base, List, Retrieve):
permission_classes = [AllowMetadata | IsAdmin] permission_classes = [AllowMetadata | IsAdmin]
serializer_class = serializers.HistorySerializer serializer_class = serializers.HistorySerializer
queryset = models.HistoryIndex.objects.order_by('-history_date') queryset = models.HistoryIndex.objects.order_by('-history_date')[:100]
class RegistrationView(RegisterView): class RegistrationView(RegisterView):