On this page

    Get All Privileges

    Note:

    This functionality is for Dremio v16.0+ Enterprise Edition only.

    This API lists all permissions that may be assigned to a user/group for an object type, or grantType. No user or role information is provided in the API response.

    Endpoint Syntax

    Method and URL
    GET /api/v3/catalog/privileges?type={grantType}
    

    Required Privileges

    No specific privileges or account type is required to execute this API. It is available to all users.

    Request Parameters

    The following objects must be used in place of grantType:

    • SPACE
    • SOURCE
    • FOLDER or SCHEMA
    • VDS or VIEW
    • PDS or TABLE

    Response Output

    Response output
    {
     "availablePrivileges": [
       {
         "grantType": "SPACE",
         "privileges": [
           "ALTER",
           "ALTER_REFLECTIONS",
           "MANAGE_GRANTS",
           "MODIFY",
           "SELECT",
           "VIEW_REFLECTIONS"
         ]
       },
       {
         "grantType": "SOURCE",
         "privileges": [
           "ALTER",
           "ALTER_REFLECTIONS",
           "CREATE_TABLE",
           "MANAGE_GRANTS",
           "MODIFY",
           "SELECT",
           "VIEW_REFLECTIONS"
         ]
       },
       {
         "grantType": "FOLDER",
         "privileges": [
           "ALTER",
           "ALTER_REFLECTIONS",
           "CREATE_TABLE",
           "SELECT",
           "VIEW_REFLECTIONS"
         ]
       },
       {
         "grantType": "PDS",
         "privileges": [
           "ALTER",
           "SELECT"
         ]
       },
       {
         "grantType": "VDS",
         "privileges": [
           "ALTER",
           "SELECT"
         ]
       }
     ]
    }
    

    Example: grantType is Space

    The following example shows a response when the grantType is specified as SPACE.

    SPACE grantType example
    {
      "availablePrivileges": [
        {
          "grantType": "SPACE",
          "privileges": [
            "ALTER",
            "ALTER_REFLECTIONS",
            "MANAGE_GRANTS",
            "MODIFY",
            "SELECT",
            "VIEW_REFLECTIONS"
          ]
        }
      ]
    }
    

    Response Codes

    • 200 - Success.
    • 404 - An object with the entityId is not found.

    Example Requests

    Curl Request: Privileges for All Objects

    Example request
    curl -X GET --location "http://localhost:9047/api/v3/grant?grantType=PROJECT" \
        -H "Authorization: _dremiohrr395nv31g8k610616tucp91g" \
        -H "Content-Type: application/json" \
        -H "Accept: application/json"
    

    Curl Request: Privileges for the Space Object

    Example request
    curl -X GET --location "http://localhost:9047/api/v3/grant?grantType=PROJECT" \
        -H "Authorization: _dremiohrr395nv31g8k610616tucp91g" \
        -H "Content-Type: application/json" \
        -H "Accept: application/json"