Grant Privilege
POST
/api/v1/permissions/grant
const url = 'https://example.com/api/v1/permissions/grant';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"privilege":"example","object_type":"example","object_name":"example","grantee_name":"example","grantee_type":"example","grant_option":false}'};
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/grant \ --header 'Content-Type: application/json' \ --data '{ "privilege": "example", "object_type": "example", "object_name": "example", "grantee_name": "example", "grantee_type": "example", "grant_option": false }'Grant a privilege on an object to a user/role.
Args: request: Grant request details
Returns: PermissionOperationResponse with operation result
Raises: HTTPException: If grant operation fails
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
GrantRequest
Request to grant a privilege.
object
privilege
required
Privilege
Privilege to grant (SELECT, INSERT, UPDATE, etc.)
string
object_type
required
Object Type
Object type (TABLE, VIEW, SCHEMA, DATABASE, etc.)
string
object_name
required
Object Name
Object name
string
grantee_name
required
Grantee Name
User/role to grant to
string
grantee_type
required
Grantee Type
Grantee type (USER or ROLE)
string
grant_option
Grant Option
Whether to grant with grant option
boolean
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" } ]}