policies: use GroupSerializer for PolicyBinding API
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
d71d45b958
commit
3cc7d54cc1
|
@ -17,6 +17,7 @@ from rest_framework.viewsets import GenericViewSet, ModelViewSet
|
|||
from structlog.stdlib import get_logger
|
||||
|
||||
from authentik.core.api.applications import user_app_cache_key
|
||||
from authentik.core.api.groups import GroupSerializer
|
||||
from authentik.core.api.utils import (
|
||||
CacheSerializer,
|
||||
MetaNameSerializer,
|
||||
|
@ -176,6 +177,8 @@ class PolicyBindingSerializer(ModelSerializer):
|
|||
required=True,
|
||||
)
|
||||
|
||||
group = GroupSerializer(required=False)
|
||||
|
||||
class Meta:
|
||||
|
||||
model = PolicyBinding
|
||||
|
|
53
swagger.yaml
53
swagger.yaml
|
@ -12216,58 +12216,7 @@ definitions:
|
|||
type: boolean
|
||||
readOnly: true
|
||||
group:
|
||||
description: Custom Group model which supports a basic hierarchy
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
properties:
|
||||
group_uuid:
|
||||
title: Group uuid
|
||||
type: string
|
||||
format: uuid
|
||||
readOnly: true
|
||||
name:
|
||||
title: Name
|
||||
type: string
|
||||
maxLength: 80
|
||||
minLength: 1
|
||||
is_superuser:
|
||||
title: Is superuser
|
||||
description: Users added to this group will be superusers.
|
||||
type: boolean
|
||||
attributes:
|
||||
title: Attributes
|
||||
type: object
|
||||
parent:
|
||||
description: Custom Group model which supports a basic hierarchy
|
||||
required:
|
||||
- name
|
||||
- parent
|
||||
type: object
|
||||
properties:
|
||||
group_uuid:
|
||||
title: Group uuid
|
||||
type: string
|
||||
format: uuid
|
||||
readOnly: true
|
||||
name:
|
||||
title: Name
|
||||
type: string
|
||||
maxLength: 80
|
||||
minLength: 1
|
||||
is_superuser:
|
||||
title: Is superuser
|
||||
description: Users added to this group will be superusers.
|
||||
type: boolean
|
||||
attributes:
|
||||
title: Attributes
|
||||
type: object
|
||||
parent:
|
||||
title: Parent
|
||||
type: string
|
||||
format: uuid
|
||||
readOnly: true
|
||||
readOnly: true
|
||||
$ref: '#/definitions/Group'
|
||||
user:
|
||||
description: Custom User model to allow easier adding of user-based settings
|
||||
required:
|
||||
|
|
Reference in New Issue