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 structlog.stdlib import get_logger
|
||||||
|
|
||||||
from authentik.core.api.applications import user_app_cache_key
|
from authentik.core.api.applications import user_app_cache_key
|
||||||
|
from authentik.core.api.groups import GroupSerializer
|
||||||
from authentik.core.api.utils import (
|
from authentik.core.api.utils import (
|
||||||
CacheSerializer,
|
CacheSerializer,
|
||||||
MetaNameSerializer,
|
MetaNameSerializer,
|
||||||
|
@ -176,6 +177,8 @@ class PolicyBindingSerializer(ModelSerializer):
|
||||||
required=True,
|
required=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
group = GroupSerializer(required=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
||||||
model = PolicyBinding
|
model = PolicyBinding
|
||||||
|
|
53
swagger.yaml
53
swagger.yaml
|
@ -12216,58 +12216,7 @@ definitions:
|
||||||
type: boolean
|
type: boolean
|
||||||
readOnly: true
|
readOnly: true
|
||||||
group:
|
group:
|
||||||
description: Custom Group model which supports a basic hierarchy
|
$ref: '#/definitions/Group'
|
||||||
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
|
|
||||||
user:
|
user:
|
||||||
description: Custom User model to allow easier adding of user-based settings
|
description: Custom User model to allow easier adding of user-based settings
|
||||||
required:
|
required:
|
||||||
|
|
Reference in New Issue