Policy

Visibility policies control read and write access to DataWarehouse objects. See DataWarehouse Authorization and Permission for how policy groups map to API access.

Get

Get a single Policy.

GET /api/1/policy/$policy_id

Name Type Required Description
policy_id int Yes ID of the Policy.

Example of response:

{
    "id": 1,
    "name": "public",
    "read_group": null,
    "write_group": 2
}
Field Type Description
read_group int or null Django auth Group id required to read objects with this policy.
write_group int or null Django auth Group id required to write objects with this policy.

List

Get a list of Policies.

GET /api/1/policy

Example of response:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "name": "public",
            "read_group": null,
            "write_group": 2
        }
    ]
}

Create

Create a new Policy. (Auth Required)

POST /api/1/policy

Request body should contain JSON with policy data:

{
    "name": "public",
    "read_group": null,
    "write_group": 2
}
Field Type Required Description
name string Yes Unique policy name.
read_group int No Django auth Group id for read access.
write_group int No Django auth Group id for write access.

Example of response: same format as Get.

Partial Update

Update only some fields of a single Policy. (Auth Required)

PATCH /api/1/policy/$policy_id

Name Type Required Description
policy_id int Yes ID of the Policy.

Updatable fields: name, read_group, write_group.

Full Update

Replace all fields of a single Policy. (Auth Required)

PUT /api/1/policy/$policy_id

Name Type Required Description
policy_id int Yes ID of the Policy.

Request body should contain the same fields as Create.

Example of response: same format as Get.

Delete

Delete a single Policy. (Auth Required)

DELETE /api/1/policy/$policy_id

Name Type Required Description
policy_id int Yes ID of the Policy.

Responds with 204 and empty content.