cancel
Showing results for 
Search instead for 
Did you mean: 
Data Governance
Join discussions on data governance practices, compliance, and security within the Databricks Community. Exchange strategies and insights to ensure data integrity and regulatory compliance.
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks Rest API to Update permissions

mayank_gupta
New Contributor II

I am trying to update permissions of an object using Rest API. 

Endpoint I am using is "/api/2.1/unity-catalog/permissions/catalog/catalog_name"

Payload is :

    payload = {
                "changes": [
                    {
                        "principal": <group_name>,
                        "add": [
                            "ALL PRIVILEGES"
                        ]
                    }
                ]
            }
 
But I am receiving an error:
{ "detail": { "error_code": "INVALID_PARAMETER_VALUE", "message": "Privilege is not applicable to this entity [catalog_name:CATALOG/CATALOG_STANDARD]. If this seems unexpected, please check the privilege version of the metastore in use [1.0].", "details": [ { "@type": "type.googleapis.com/google.rpc.RequestInfo", "request_id": <req_id>, "serving_data": "" } ] } }
 
I am receiving this error for all securable types and privileges, for both add and remove.
1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @mayank_gupta,

The error you are encountering, "INVALID_PARAMETER_VALUE," indicates that the privilege "ALL PRIVILEGES" is not applicable to the entity you are trying to modify. This error message suggests that the privilege version of the metastore in use is 1.0, which might not support the "ALL PRIVILEGES" setting for the specified catalog.

Instead of using "ALL PRIVILEGES," try specifying individual privileges that are supported for the catalog entity

payload = {
    "changes": [
        {
            "principal": "<group_name>",
            "add": [
                "SELECT",
                "MODIFY",
                "CREATE"
            ]
        }
    ]
}
 

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group