--- 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:
()
| 11 | |
| 12 | @blueprint.route("/api/2/groups", methods=["GET"]) |
| 13 | def 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 | ) |
nothing calls this directly
no test coverage detected