Roles
Endpoint to create a role.
Args: role: The role to create. user: The authenticated user. rbac: RBAC component.
Raises: IllegalOperationError: If the role is an organization role. IllegalOperationError: If the role has no permissions.
Returns: The created role.
Model for creating roles.
Scope levels.
Enum that represents the type of a role.
normalPossible values: Successful Response
Model for viewing roles.
Scope levels.
Enum that represents the type of a role.
Validation Error
POST /roles HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 250
{
"name": "text",
"description": "text",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"level": "organization",
"system_managed": true,
"type": "normal",
"permissions": [
{
"resource": {
"level": "organization",
"type": "text",
"id": "text"
},
"action": "text"
}
]
}{
"name": "text",
"description": "text",
"id": "123e4567-e89b-12d3-a456-426614174000",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"level": "organization",
"system_managed": true,
"type": "normal"
}Endpoint to get a role.
Args: role_id: ID of the role to get. user: The authenticated user. rbac: RBAC component.
Returns: The role.
Successful Response
Model for viewing roles.
Scope levels.
Enum that represents the type of a role.
Validation Error
GET /roles/{role_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"name": "text",
"description": "text",
"id": "123e4567-e89b-12d3-a456-426614174000",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"level": "organization",
"system_managed": true,
"type": "normal"
}Endpoint to delete a role.
Args: role_id: ID of the role to delete. user: The authenticated user. rbac: RBAC component.
Raises: IllegalOperationError: If the role is system managed.
Successful Response
Validation Error
DELETE /roles/{role_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
No content
Endpoint to update a role.
Args: role_id: ID of the role to update. update: The role update. user: The authenticated user. rbac: RBAC component.
Raises: IllegalOperationError: If the role has no permissions.
Returns: The updated role.
Model for updating roles.
Successful Response
Model for viewing roles.
Scope levels.
Enum that represents the type of a role.
Validation Error
PATCH /roles/{role_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 132
{
"name": "text",
"description": "text",
"permissions": [
{
"resource": {
"level": "organization",
"type": "text",
"id": "text"
},
"action": "text"
}
]
}{
"name": "text",
"description": "text",
"id": "123e4567-e89b-12d3-a456-426614174000",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"level": "organization",
"system_managed": true,
"type": "normal"
}Last updated
Was this helpful?