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/policies/api.py
2020-05-14 13:51:05 +02:00

22 lines
537 B
Python

"""policy API Views"""
from rest_framework.serializers import ModelSerializer
from rest_framework.viewsets import ModelViewSet
from passbook.policies.models import PolicyBinding
class PolicyBindingSerializer(ModelSerializer):
"""PolicyBinding Serializer"""
class Meta:
model = PolicyBinding
fields = ["policy", "target", "enabled", "order"]
class PolicyBindingViewSet(ModelViewSet):
"""PolicyBinding Viewset"""
queryset = PolicyBinding.objects.all()
serializer_class = PolicyBindingSerializer