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" },