This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/passbook/admin/api/v1/users.py

24 lines
603 B
Python

"""passbook admin user API"""
from rest_framework.permissions import IsAdminUser
from rest_framework.serializers import ModelSerializer
from rest_framework.viewsets import ModelViewSet
from passbook.core.models import User
class UserSerializer(ModelSerializer):
"""User Serializer"""
class Meta:
model = User
fields = ['is_superuser', 'username', 'name', 'email', 'date_joined',
'uuid']
class UserViewSet(ModelViewSet):
"""User Viewset"""
permission_classes = [IsAdminUser]
serializer_class = UserSerializer
queryset = User.objects.all()