Grants {{< chip enterprise >}}
Use the Catalog API to grant user and role privileges on specific catalog objects.
Use the Privileges endpoint to retrieve lists of the privileges that are available on each type of catalog object.
{{< codeheader "Grants Object" >}}
{
"id": "7f1c4660-cd7b-40d0-97d1-b8a6f431cbda",
"availablePrivileges": [
"ALTER",
"DELETE",
"INSERT",
"MANAGE_GRANTS",
"SELECT",
"TRUNCATE",
"UPDATE"
],
"grants": [
{
"privileges": [
"ALTER",
"SELECT",
"MANAGE_GRANTS"
],
"granteeType": "USER",
"id": "27937a63-e7e5-4478-8d3c-4ad3f20d43c0",
"name": "jeansmith",
"firstName": "Jean",
"lastName": "Smith",
"email": "jean_smith@example.com"
},
{
"privileges": [
"ALTER",
"SELECT"
],
"granteeType": "ROLE",
"id": "0f2d94e0-bb5e-4c03-8c6f-62d379d10889",
"name": "examplerole"
}
]
}
Grants Attributes
{{< api-section file="data/software-api/grants.json" data="grantsAttributes" >}}
grants
{{< api-section file="data/software-api/grants.json" data="grantsArrayAttributes" >}}
Creating or Updating Privilege Grants on a Catalog Object
Create or update the privileges granted to users and roles on the specified catalog object.
You must have the MANAGE GRANTS privilege to create or update privilege grants on catalog objects.
{{< codeheader "Method and URL" >}}
PUT /api/v3/catalog/{id}/grants
Parameters
{{< api-section file="data/software-api/grants.json" data="createUpdateGrantsParameters" >}}
grants
{{< api-section file="data/software-api/grants.json" data="createUpdateGrantsArrayParameters" >}}
{{< codeheader "Example Request" >}}
curl -X PUT 'https://{hostname}/api/v3/catalog/7f1c4660-cd7b-40d0-97d1-b8a6f431cbda/grants' \
--header 'Authorization: _dremio{tokenstring}' \
--header 'Content-Type: application/json' \
--data-raw '{
"grants": [
{
"privileges": [
"ALTER",
"SELECT",
"MANAGE_GRANTS"
],
"granteeType": "USER",
"id": "27937a63-e7e5-4478-8d3c-4ad3f20d43c0"
},
{
"privileges": [
"SELECT",
"ALTER"
],
"granteeType": "ROLE",
"id": "0f2d94e0-bb5e-4c03-8c6f-62d379d10889"
}
]
}'
{{< codeheader "Example Response" >}}
No response
Response Status Codes
{{< api-responses file="data/software-api/grants.json" data="createUpdateGrantsResponseCodes" >}}
Retrieving Privileges and Grantees on a Catalog Object
Retrieve information about the privileges granted to users and roles on the specified catalog object.
You must have the MANAGE GRANTS privilege to retrieve privilege grants on catalog objects.
{{< codeheader "Method and URL" >}}
GET /api/v3/catalog/{id}/grants
Parameters
{{< api-section file="data/software-api/grants.json" data="retrieveGrantsParameters" >}}
{{< codeheader "Example Request" >}}
curl -X GET 'https://{hostname}/api/v3/catalog/7f1c4660-cd7b-40d0-97d1-b8a6f431cbda/grants' \
--header 'Authorization: _dremio{tokenstring}' \
--header 'Content-Type: application/json'
{{< codeheader "Example Response" >}}
{
"id": "7f1c4660-cd7b-40d0-97d1-b8a6f431cbda",
"availablePrivileges": [
"ALTER",
"DELETE",
"INSERT",
"MANAGE_GRANTS",
"SELECT",
"TRUNCATE",
"UPDATE"
],
"grants": [
{
"privileges": [
"ALTER",
"SELECT",
"MANAGE_GRANTS"
],
"granteeType": "USER",
"id": "27937a63-e7e5-4478-8d3c-4ad3f20d43c0",
"name": "jeansmith",
"firstName": "Jean",
"lastName": "Smith",
"email": "jean_smith@example.com"
},
{
"privileges": [
"ALTER",
"SELECT"
],
"granteeType": "ROLE",
"id": "0f2d94e0-bb5e-4c03-8c6f-62d379d10889",
"name": "examplerole"
}
]
}
Response Status Codes
{{< api-responses file="data/software-api/grants.json" data="retrieveGrantsResponseCodes" >}}