From 0b7bf7eb8a44c0ce36296ee907ef89f0035a3933 Mon Sep 17 00:00:00 2001 From: Javier Romero Castro Date: Fri, 12 May 2023 16:40:16 +0200 Subject: [PATCH] groups: updates mapping to contain description * closes https://github.com/inveniosoftware/invenio-app-rdm/issues/2186 --- invenio_users_resources/records/api.py | 10 +++++++--- .../records/mappings/os-v1/groups/group-v1.0.0.json | 3 +++ .../records/mappings/os-v2/groups/group-v1.0.0.json | 3 +++ .../records/mappings/v7/groups/group-v1.0.0.json | 3 +++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/invenio_users_resources/records/api.py b/invenio_users_resources/records/api.py index 5947b86..bcc0a6a 100644 --- a/invenio_users_resources/records/api.py +++ b/invenio_users_resources/records/api.py @@ -53,9 +53,10 @@ def parse_user_data(user): def parse_role_data(role): """Parse the role's information into a dictionary.""" data = { - "id": role.name, # due to flask security exposing user id - "name": role.description, - "is_managed": True, # TODO + "id": role.id, + "name": role.name, + "description": role.description, + "is_managed": role.is_managed, } return data @@ -189,6 +190,9 @@ class GroupAggregate(Record): name = DictField("name") """The group's name.""" + description = DictField("description") + """The group's name.""" + is_managed = DictField("is_managed") """If the group is managed manually.""" diff --git a/invenio_users_resources/records/mappings/os-v1/groups/group-v1.0.0.json b/invenio_users_resources/records/mappings/os-v1/groups/group-v1.0.0.json index b3ef440..7b1acc8 100644 --- a/invenio_users_resources/records/mappings/os-v1/groups/group-v1.0.0.json +++ b/invenio_users_resources/records/mappings/os-v1/groups/group-v1.0.0.json @@ -28,6 +28,9 @@ } } }, + "description": { + "type": "text" + }, "provider": { "type": "text" }, diff --git a/invenio_users_resources/records/mappings/os-v2/groups/group-v1.0.0.json b/invenio_users_resources/records/mappings/os-v2/groups/group-v1.0.0.json index b3ef440..7b1acc8 100644 --- a/invenio_users_resources/records/mappings/os-v2/groups/group-v1.0.0.json +++ b/invenio_users_resources/records/mappings/os-v2/groups/group-v1.0.0.json @@ -28,6 +28,9 @@ } } }, + "description": { + "type": "text" + }, "provider": { "type": "text" }, diff --git a/invenio_users_resources/records/mappings/v7/groups/group-v1.0.0.json b/invenio_users_resources/records/mappings/v7/groups/group-v1.0.0.json index b3ef440..7b1acc8 100644 --- a/invenio_users_resources/records/mappings/v7/groups/group-v1.0.0.json +++ b/invenio_users_resources/records/mappings/v7/groups/group-v1.0.0.json @@ -28,6 +28,9 @@ } } }, + "description": { + "type": "text" + }, "provider": { "type": "text" },