backend/app/users/api/views.py

13 lines
389 B
Python
Raw Normal View History

from rest_framework import generics
from rest_framework.permissions import IsAuthenticated
from common.permissions import IsAdmin
from users.api.serializers import UserSerializer
from users.models import User
class ListCreateUserApi(generics.ListCreateAPIView):
serializer_class = UserSerializer
permission_classes = [IsAuthenticated, IsAdmin]
queryset = User.objects.all()