Dashboards: Remove deprecated endpoints from docs (#97073)
This commit is contained in:
@@ -183,161 +183,3 @@ Status Codes:
|
||||
- **401** - Unauthorized
|
||||
- **403** - Access denied
|
||||
- **404** - Dashboard not found
|
||||
|
||||
## Get permissions for a dashboard by id
|
||||
|
||||
{{% admonition type="warning" %}}
|
||||
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new dashboard permissions API](#get-permissions-for-a-dashboard).
|
||||
{{% /admonition %}}
|
||||
|
||||
`GET /api/dashboards/id/:dashboardId/permissions`
|
||||
|
||||
Gets all existing permissions for the dashboard with the given `dashboardId`.
|
||||
|
||||
**Required permissions**
|
||||
|
||||
See note in the [introduction]({{< ref "#dashboard-permission-api" >}}) for an explanation.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
| Action | Scope |
|
||||
| ----------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `dashboards.permissions:read` | <ul><li>`dashboards:*`</li><li>`dashboards:uid:*`</li><li>`folders:*`</li><li>`folders:uid:*`</li></ul> |
|
||||
{ .no-spacing-list }
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
**Example request**:
|
||||
|
||||
```http
|
||||
GET /api/dashboards/id/1/permissions HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
```
|
||||
|
||||
**Example Response**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json; charset=UTF-8
|
||||
Content-Length: 551
|
||||
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"dashboardId": -1,
|
||||
"created": "2017-06-20T02:00:00+02:00",
|
||||
"updated": "2017-06-20T02:00:00+02:00",
|
||||
"userId": 0,
|
||||
"userLogin": "",
|
||||
"userEmail": "",
|
||||
"teamId": 0,
|
||||
"team": "",
|
||||
"role": "Viewer",
|
||||
"permission": 1,
|
||||
"permissionName": "View",
|
||||
"uid": "",
|
||||
"title": "",
|
||||
"slug": "",
|
||||
"isFolder": false,
|
||||
"url": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"dashboardId": -1,
|
||||
"created": "2017-06-20T02:00:00+02:00",
|
||||
"updated": "2017-06-20T02:00:00+02:00",
|
||||
"userId": 0,
|
||||
"userLogin": "",
|
||||
"userEmail": "",
|
||||
"teamId": 0,
|
||||
"team": "",
|
||||
"role": "Editor",
|
||||
"permission": 2,
|
||||
"permissionName": "Edit",
|
||||
"uid": "",
|
||||
"title": "",
|
||||
"slug": "",
|
||||
"isFolder": false,
|
||||
"url": ""
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
|
||||
- **200** - Ok
|
||||
- **401** - Unauthorized
|
||||
- **403** - Access denied
|
||||
- **404** - Dashboard not found
|
||||
|
||||
## Update permissions for a dashboard by id
|
||||
|
||||
{{% admonition type="warning" %}}
|
||||
This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the [new dashboard permissions API](#update-permissions-for-a-dashboard).
|
||||
{{% /admonition %}}
|
||||
|
||||
`POST /api/dashboards/id/:dashboardId/permissions`
|
||||
|
||||
Updates permissions for a dashboard. This operation will remove existing permissions if they're not included in the request.
|
||||
|
||||
**Required permissions**
|
||||
|
||||
See note in the [introduction]({{< ref "#dashboard-permission-api" >}}) for an explanation.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
| Action | Scope |
|
||||
| ------------------------------ | ------------------------------------------------------------------------------------------------------- |
|
||||
| `dashboards.permissions:write` | <ul><li>`dashboards:*`</li><li>`dashboards:uid:*`</li><li>`folders:*`</li><li>`folders:uid:*`</li></ul> |
|
||||
{ .no-spacing-list }
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
**Example request**:
|
||||
|
||||
```http
|
||||
POST /api/dashboards/id/1/permissions
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"role": "Viewer",
|
||||
"permission": 1
|
||||
},
|
||||
{
|
||||
"role": "Editor",
|
||||
"permission": 2
|
||||
},
|
||||
{
|
||||
"teamId": 1,
|
||||
"permission": 1
|
||||
},
|
||||
{
|
||||
"userId": 11,
|
||||
"permission": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
JSON body schema:
|
||||
|
||||
- **items** - The permission items to add/update. Items that are omitted from the list will be removed.
|
||||
|
||||
**Example response**:
|
||||
|
||||
```http
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json; charset=UTF-8
|
||||
Content-Length: 35
|
||||
|
||||
{"message":"Dashboard permissions updated"}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
|
||||
- **200** - Ok
|
||||
- **401** - Unauthorized
|
||||
- **403** - Access denied
|
||||
- **404** - Dashboard not found
|
||||
|
||||
Reference in New Issue
Block a user