grafana/pkg
Matthew Jacobson 5f48619c9a
Alerting: Handle custom dashboard permissions in migration service (#74504)
* 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.
2023-10-12 18:12:40 -04:00
..
api RBAC: Fix plugins pages access-control (#76321) 2023-10-12 10:46:43 +02:00
apis K8s: Namespace parsing updates (default + stack-id) (#76310) 2023-10-12 21:34:50 +03:00
build Building: Remove dependency to urw-fonts in RPM packages (#76198) 2023-10-10 08:15:54 +02:00
bus Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
cmd Expose enterprise-commit in server version output (#75897) 2023-10-04 14:51:35 +02:00
codegen Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
components imagestorage: fix templating of public_url option for webdav (#74885) 2023-09-28 00:35:10 +03:00
cuectx Kinds: publish kinds to kind registry (#67515) 2023-06-13 14:01:29 +02:00
events Alerting: Update rules version when folder title is updated (#53013) 2022-08-01 19:28:38 -04:00
expr SSE: Support hysteresis threshold expression (#70998) 2023-10-10 17:51:50 +03:00
extensions Chore: Replace gofpdf (#75805) 2023-10-02 15:32:35 +02:00
ifaces/gcsifaces Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
infra SigningKeys: Add jwks endpoint (#76040) 2023-10-05 15:17:31 +02:00
kinds Playlist: Use a different go struct for sql service vs k8s (#76393) 2023-10-12 08:29:06 -07:00
kindsysreport Playlist: Use a different go struct for sql service vs k8s (#76393) 2023-10-12 08:29:06 -07:00
login Auth: Add support for role mapping and allowed groups in Google OIDC (#76266) 2023-10-10 18:07:23 +02:00
middleware RBAC: Fix plugins pages access-control (#76321) 2023-10-12 10:46:43 +02:00
mocks/mock_gcsifaces Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
models Auth: Add empty role definition (#64694) 2023-07-06 15:40:06 +02:00
modules Chore: refactor grafana-apiserver a bit (#74177) 2023-08-31 09:12:01 -04:00
plugins Plugins: Chore: Renamed instrumentation middleware to metrics middleware (#76186) 2023-10-11 12:42:32 +02:00
registry Playlist: Use a different go struct for sql service vs k8s (#76393) 2023-10-12 08:29:06 -07:00
server Alerting: Move legacy alert migration from sqlstore migration to service (#72702) 2023-10-12 13:43:10 +01:00
services Alerting: Handle custom dashboard permissions in migration service (#74504) 2023-10-12 18:12:40 -04:00
setting Live: Allow setting the engine password (#76289) 2023-10-11 09:45:24 +01:00
tests Alerting: Add provenance field to /api/v1/provisioning/alert-rules (#76252) 2023-10-11 14:51:20 +01:00
tsdb Pyroscope: Change phlare/api module to pyroscope/api module (#76271) 2023-10-10 18:13:14 +02:00
util Instrumentation: Handle context.Canceled (#75867) 2023-10-10 12:28:39 +02:00
web Auth: Implement requester interface in access control module (#74289) 2023-09-06 11:16:10 +02:00
README.md Chore: Move all backend contribution documents to a single directory (#61140) 2023-01-11 11:16:52 +01:00
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.