mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
The OpenAPI document keys every operation by its full path, so the spec described endpoints that no longer exist the moment the server moved. The openApiSync analyzer cross-checks each registered subrouter against that document and reconstructs the prefix from a literal of its own, so spec and analyzer have to move together or every route reports as missing. Its special case for the v5 root goes away with the root itself. The api/v4 directory keeps its name: it is where the spec sources live, not a URL anyone requests. Co-authored-by: Hanzo Dev <[email protected]>
181 lines
4.9 KiB
YAML
181 lines
4.9 KiB
YAML
"/v1/team/roles":
|
|
get:
|
|
tags:
|
|
- roles
|
|
summary: Get a list of all the roles
|
|
description: |
|
|
##### Permissions
|
|
|
|
`manage_system` permission is required.
|
|
|
|
__Minimum server version__: 5.33
|
|
operationId: GetAllRoles
|
|
responses:
|
|
"200":
|
|
description: Roles retrieval successful
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Role"
|
|
"400":
|
|
$ref: "#/components/responses/BadRequest"
|
|
"401":
|
|
$ref: "#/components/responses/Unauthorized"
|
|
"403":
|
|
$ref: "#/components/responses/Forbidden"
|
|
"/v1/team/roles/{role_id}":
|
|
get:
|
|
tags:
|
|
- roles
|
|
summary: Get a role
|
|
description: |
|
|
Get a role from the provided role id.
|
|
|
|
##### Permissions
|
|
Requires an active session but no other permissions.
|
|
|
|
__Minimum server version__: 4.9
|
|
operationId: GetRole
|
|
parameters:
|
|
- name: role_id
|
|
in: path
|
|
description: Role GUID
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Role retrieval successful
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Role"
|
|
"401":
|
|
$ref: "#/components/responses/Unauthorized"
|
|
"404":
|
|
$ref: "#/components/responses/NotFound"
|
|
"/v1/team/roles/name/{role_name}":
|
|
get:
|
|
tags:
|
|
- roles
|
|
summary: Get a role
|
|
description: |
|
|
Get a role from the provided role name.
|
|
|
|
##### Permissions
|
|
Requires an active session but no other permissions.
|
|
|
|
__Minimum server version__: 4.9
|
|
operationId: GetRoleByName
|
|
parameters:
|
|
- name: role_name
|
|
in: path
|
|
description: Role Name
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Role retrieval successful
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Role"
|
|
"401":
|
|
$ref: "#/components/responses/Unauthorized"
|
|
"404":
|
|
$ref: "#/components/responses/NotFound"
|
|
"/v1/team/roles/{role_id}/patch":
|
|
put:
|
|
tags:
|
|
- roles
|
|
summary: Patch a role
|
|
description: >
|
|
Partially update a role by providing only the fields you want to update.
|
|
Omitted fields will not be updated. The fields that can be updated are
|
|
defined in the request body, all other provided fields will be ignored.
|
|
|
|
|
|
##### Permissions
|
|
|
|
Must have `sysconsole_write_user_management_permissions` or `manage_system` permission.
|
|
When updating the role of a system admin, the `manage_system` permission is mandatory.
|
|
|
|
|
|
__Minimum server version__: 4.9
|
|
operationId: PatchRole
|
|
parameters:
|
|
- name: role_id
|
|
in: path
|
|
description: Role GUID
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
permissions:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: The permissions the role should grant.
|
|
description: Role object to be updated
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: Role patch successful
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Role"
|
|
"400":
|
|
$ref: "#/components/responses/BadRequest"
|
|
"401":
|
|
$ref: "#/components/responses/Unauthorized"
|
|
"403":
|
|
$ref: "#/components/responses/Forbidden"
|
|
"404":
|
|
$ref: "#/components/responses/NotFound"
|
|
/v1/team/roles/names:
|
|
post:
|
|
tags:
|
|
- roles
|
|
summary: Get a list of roles by name
|
|
description: |
|
|
Get a list of roles from their names.
|
|
|
|
##### Permissions
|
|
Requires an active session but no other permissions.
|
|
|
|
__Minimum server version__: 4.9
|
|
operationId: GetRolesByNames
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: List of role names
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: Role list retrieval successful
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Role"
|
|
"400":
|
|
$ref: "#/components/responses/BadRequest"
|
|
"401":
|
|
$ref: "#/components/responses/Unauthorized"
|
|
"404":
|
|
$ref: "#/components/responses/NotFound"
|