MCPcopy Create free account
hub / github.com/alephdata/aleph / index

Function index

aleph/views/groups_api.py:13–42  ·  view source on GitHub ↗

--- get: summary: List groups description: >- Get the list of groups the user belongs to. Groups are used for authorization. responses: '200': description: OK content: application/json: schema:

()

Source from the content-addressed store, hash-verified

11
12@blueprint.route("/api/2/groups", methods=["GET"])
13def index():
14 """
15 ---
16 get:
17 summary: List groups
18 description: >-
19 Get the list of groups the user belongs to. Groups are used for
20 authorization.
21 responses:
22 '200':
23 description: OK
24 content:
25 application/json:
26 schema:
27 type: object
28 allOf:
29 - $ref: '#/components/schemas/QueryResponse'
30 properties:
31 results:
32 type: array
33 items:
34 $ref: '#/components/schemas/Role'
35 tags:
36 - Role
37 """
38 require(request.authz.logged_in)
39 q = Role.all_groups(request.authz)
40 return jsonify(
41 {"total": q.count(), "results": RoleSerializer().serialize_many(q.all())}
42 )

Callers

nothing calls this directly

Calls 6

requireFunction · 0.90
jsonifyFunction · 0.90
RoleSerializerClass · 0.90
all_groupsMethod · 0.80
serialize_manyMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected