Skip to content

Grant Privilege

POST
/api/v1/permissions/grant
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

X-Environment-Id
Any of:
string
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
/^(USER|ROLE)$/
grant_option
Grant Option

Whether to grant with grant option

boolean

Successful Response

Media typeapplication/json
PermissionOperationResponse

Response for permission operations.

object
success
required
Success

Whether the operation was successful

boolean
message
required
Message

Operation result message

string
details
Any of:
object
key
additional properties
any
Examplegenerated
{
"success": true,
"message": "example",
"details": {}
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}