On this page

    Role Privileges enterprise

    Use the Role API to retrieve information about the privileges assigned to roles.

    Role Privileges Object
    {
      "data": [
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "SELECT"
        },
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "CREATE_TABLE"
        },
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "INSERT"
        },
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "DROP"
        },
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "ALTER"
        },
        {
          "name": "mysql",
          "type": "SOURCE",
          "privilege": "EXTERNAL_QUERY"
        },
        {
          "name": "Samples",
          "type": "SOURCE",
          "privilege": "SELECT"
        },
        {
          "name": "Samples.\"samples.dremio.com\"",
          "type": "FOLDER",
          "privilege": "SELECT"
        },
        {
          "name": "Samples.\"samples.dremio.com\".\"SF_incidents2016.json\"",
          "type": "DATASET",
          "privilege": "SELECT"
        },
        {
          "name": "testing",
          "type": "SPACE",
          "privilege": "SELECT"
        }
      ]
    }
    

    Role Privileges Attributes

    data

    [Object]

    Information about the privileges the specified role has for the entities in the current organization, up to a maximum of 100 privileges. Each object in the data array describes a privilege the role has for a specific entity.

    data

    name

    String (UUID)

    Name of the object to which the privilege applies. The name includes the objects's parent objects, if any.

    Example hive


    type

    String

    Type of the object to which the privilege applies.

    Enum SPACE , SOURCE , HOME , FOLDER , DATASET , FUNCTION

    Example SOURCE


    privilege

    String

    Name of the privilege that the role has for the object. Available privileges vary for different object types.

    Example SELECT

    Retrieving Role Privileges

    Retrieve the specified role’s privileges.

    Method and URL
    GET /api/v3/role/{id}/privilege
    

    Parameters

    id

    path

    String (UUID)

    Unique identifier of the role whose privileges you want to retrieve.

    Example 3d83e7d7-98ee-4afa-ebdd-41c30eb92744


    Example Request
    curl -X GET 'https://{DREMIO_ORIGIN}/api/v3/role/3d83e7d7-98ee-4afa-ebdd-41c30eb92744/privilege' \
    --header 'Authorization: _dremio{tokenstring}' \
    --header 'Content-Type: application/json'
    
    Example Response
    {
      "data": [
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "SELECT"
        },
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "CREATE_TABLE"
        },
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "INSERT"
        },
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "DROP"
        },
        {
          "name": "hive",
          "type": "SOURCE",
          "privilege": "ALTER"
        },
        {
          "name": "mysql",
          "type": "SOURCE",
          "privilege": "EXTERNAL_QUERY"
        },
        {
          "name": "Samples",
          "type": "SOURCE",
          "privilege": "SELECT"
        },
        {
          "name": "Samples.\"samples.dremio.com\"",
          "type": "FOLDER",
          "privilege": "SELECT"
        },
        {
          "name": "Samples.\"samples.dremio.com\".\"SF_incidents2016.json\"",
          "type": "DATASET",
          "privilege": "SELECT"
        },
        {
          "name": "testing",
          "type": "SPACE",
          "privilege": "SELECT"
        }
      ]
    }
    

    Response Status Codes

    200

    OK

    401

    Unauthorized

    404

    Not Found

    405

    Method Not Allowed