Grant Role
POST
/api/v1/permissions/roles/grant
const url = 'https://example.com/api/v1/permissions/roles/grant';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"role_name":"example","grantee_name":"example","grantee_type":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/permissions/roles/grant \ --header 'Content-Type: application/json' \ --data '{ "role_name": "example", "grantee_name": "example", "grantee_type": "example" }'Grant a role to a user/role.
Args: request: Role grant request details
Returns: PermissionOperationResponse with operation result
Raises: HTTPException: If role grant fails
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
RoleGrantRequest
Request to grant a role to a user/role.
object
role_name
required
Role Name
Role to grant
string
grantee_name
required
Grantee Name
User/role to grant role to
string
grantee_type
required
Grantee Type
Grantee type (USER or ROLE)
string
Examplegenerated
{ "role_name": "example", "grantee_name": "example", "grantee_type": "example"}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
PermissionOperationResponse
Response for permission operations.
object
Examplegenerated
{ "success": true, "message": "example", "details": {}}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}