mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 01:42:29 +08:00

* Set every page to have defaults of 'Enterprise' and 'Open source' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/enterprise-licensing pages to have 'Enterprise' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/recorded-queries pages to have labels cloud,enterprise * Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/stats-and-license pages to have labels cloud,enterprise * Set alerting pages to have labels cloud,enterprise,oss * Set breaking-changes pages to have labels cloud,enterprise,oss * Set dashboards pages to have labels cloud,enterprise,oss * Set datasources pages to have labels cloud,enterprise,oss * Set explore pages to have labels cloud,enterprise,oss * Set fundamentals pages to have labels cloud,enterprise,oss * Set introduction/grafana-cloud pages to have labels cloud Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix introduction pages products Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set panels-visualizations pages to have labels cloud,enterprise,oss * Set release-notes pages to have labels cloud,enterprise,oss * Set search pages to have labels cloud,enterprise,oss * Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss * Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise * Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise * Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise * Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set troubleshooting pages to have labels cloud,enterprise,oss * Set whatsnew pages to have labels cloud,enterprise,oss * Apply updated labels from review Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> --------- Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
179 lines
4.0 KiB
Markdown
179 lines
4.0 KiB
Markdown
---
|
|
aliases:
|
|
- ../../http_api/dashboardpermissions/
|
|
- ../../http_api/folder_permissions/
|
|
canonical: /docs/grafana/latest/developers/http_api/folder_permissions/
|
|
description: Grafana Folder Permissions HTTP API
|
|
keywords:
|
|
- grafana
|
|
- http
|
|
- documentation
|
|
- api
|
|
- folder
|
|
- permission
|
|
- permissions
|
|
- acl
|
|
labels:
|
|
products:
|
|
- enterprise
|
|
- oss
|
|
title: Folder Permissions HTTP API
|
|
---
|
|
|
|
# Folder Permissions API
|
|
|
|
This API can be used to update/get the permissions for a folder.
|
|
|
|
Permissions with `folderId=-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:
|
|
|
|
- 1 = View
|
|
- 2 = Edit
|
|
- 4 = Admin
|
|
|
|
> If you are running Grafana Enterprise, for some endpoints you'll need to have specific permissions. Refer to [Role-based access control permissions]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/custom-role-actions-scopes" >}}) for more information.
|
|
|
|
## Get permissions for a folder
|
|
|
|
`GET /api/folders/:uid/permissions`
|
|
|
|
Gets all existing permissions for the folder with the given `uid`.
|
|
|
|
**Required permissions**
|
|
|
|
See note in the [introduction]({{< ref "#folder-permission-api" >}}) for an explanation.
|
|
|
|
| Action | Scope |
|
|
| -------------------------- | ----------- |
|
|
| `folders.permissions:read` | `folders:*` |
|
|
|
|
**Example request**:
|
|
|
|
```http
|
|
GET /api/folders/nErXDvCkzz/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
|
|
|
|
```
|
|
|
|
Status Codes:
|
|
|
|
- **200** - Ok
|
|
- **401** - Unauthorized
|
|
- **403** - Access denied
|
|
- **404** - Folder not found
|
|
|
|
## Update permissions for a folder
|
|
|
|
`POST /api/folders/:uid/permissions`
|
|
|
|
Updates permissions for a folder. This operation will remove existing permissions if they're not included in the request.
|
|
|
|
**Required permissions**
|
|
|
|
See note in the [introduction]({{< ref "#folder-permission-api" >}}) for an explanation.
|
|
|
|
| Action | Scope |
|
|
| --------------------------- | ----------- |
|
|
| `folders.permissions:write` | `folders:*` |
|
|
|
|
**Example request**:
|
|
|
|
```http
|
|
POST /api/folders/nErXDvCkzz/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
|
|
|
|
```
|
|
|
|
Status Codes:
|
|
|
|
- **200** - Ok
|
|
- **401** - Unauthorized
|
|
- **403** - Access denied
|
|
- **404** - Dashboard not found
|