mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
5f48619c9a
* Fix migration of custom dashboard permissions Dashboard alert permissions were determined by both its dashboard and folder scoped permissions, while UA alert rules only have folder scoped permissions. This means, when migrating an alert, we'll need to decide if the parent folder is a correct location for the newly created alert rule so that users, teams, and org roles have the same access to it as they did in legacy. To do this, we translate both the folder and dashboard resource permissions to two sets of SetResourcePermissionCommands. Each of these encapsulates a mapping of all: OrgRoles -> Viewer/Editor/Admin Teams -> Viewer/Editor/Admin Users -> Viewer/Editor/Admin When the dashboard permissions (including those inherited from the parent folder) differ from the parent folder permissions alone, we need to create a new folder to represent the access-level of the legacy dashboard. Compromises: When determining the SetResourcePermissionCommands we only take into account managed and basic roles. Fixed and custom roles introduce significant complexity and synchronicity hurdles. Instead, we log a warning they had the potential to override the newly created folder permissions. Also, we don't attempt to reconcile datasource permissions that were not necessary in legacy alerting. Users without access to the necessary datasources to edit an alert rule will need to obtain said access separate from the migration. |
||
---|---|---|
.. | ||
api | ||
apis | ||
build | ||
bus | ||
cmd | ||
codegen | ||
components | ||
cuectx | ||
events | ||
expr | ||
extensions | ||
ifaces/gcsifaces | ||
infra | ||
kinds | ||
kindsysreport | ||
login | ||
middleware | ||
mocks/mock_gcsifaces | ||
models | ||
modules | ||
plugins | ||
registry | ||
server | ||
services | ||
setting | ||
tests | ||
tsdb | ||
util | ||
web | ||
README.md | ||
ruleguard.rules.go |
This directory contains the code for the Grafana backend.
The contributor documentation for Grafana's backend is in /contribute/backend/README.md.