This API can be used to update/get the ACL for a dashboard or a folder.
This API can be used to update/get the permissions for a dashboard or a folder.
Permissions with dashboardId set to `-1` are the default permissions for users with the Viewer and Editor roles. Permissions can be set for a user, a team or a role (Viewer or Editor). Permissions cannot be set for Admins - they always have access to everything.
Permissions with `dashboardId=-1` are the default permissions for users with the Viewer and Editor roles. Permissions can be set for a user, a team or a role (Viewer or Editor). Permissions cannot be set for Admins - they always have access to everything.
The permission levels for the permission field:
The permission levels for the permission field:
...
@@ -21,13 +21,13 @@ The permission levels for the permission field:
...
@@ -21,13 +21,13 @@ The permission levels for the permission field:
- 2 = Edit
- 2 = Edit
- 4 = Admin
- 4 = Admin
## Get ACL/Permissions for a Dashboard or Folder
## Get permissions for a dashboard or folder
`GET /api/dashboards/id/:dashboardId/acl`
`GET /api/dashboards/id/:dashboardId/acl`
Gets all existing dashboard permissions for the dashboard or folder with the given `dashboardId`.
Gets all existing permissions for the dashboard or folder with the given `dashboardId`.
**Example request for getting the ACL/Permissions**:
**Example request**:
```http
```http
GET/api/dashboards/id/1/aclHTTP/1.1
GET/api/dashboards/id/1/aclHTTP/1.1
...
@@ -88,16 +88,17 @@ Content-Length: 551
...
@@ -88,16 +88,17 @@ Content-Length: 551
Status Codes:
Status Codes:
-**200** - Ok
-**200** - Ok
-**401** - Unauthorized
-**403** - Access denied
-**403** - Access denied
-**404** - Dashboard not found
-**404** - Dashboard/folder not found
## Save Dashboard Permissions/ACL for a Dashboard or Folder
## Update permissions for a dashboard or folder
`POST /api/dashboards/id/:dashboardId/acl`
`POST /api/dashboards/id/:dashboardId/acl`
Updates the ACL for a dashboard or folder. Takes in a list of permissions and adds, remove or updates permissions in the list in the database.
Updates permissions for a dashboard or folder. This operation will remove existing permissions if they're not included in the request.
**Example request for saving a list of permission items**: