Alerting: declare authorization actions, scopes and roles for fine-grained access (#45748)

* add actions, roles and route mapping for rule permission
* add instance\notification actions
* do not declare alerting roles if no feature flag is set (temporary)
This commit is contained in:
Yuriy Tseretyan
2022-03-08 09:22:16 -05:00
committed by GitHub
parent 874ac9180b
commit f7894db99c
4 changed files with 144 additions and 4 deletions
+2
View File
@@ -8,6 +8,7 @@ import (
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/expr"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/datasourceproxy"
"github.com/grafana/grafana/pkg/services/datasources"
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
@@ -70,6 +71,7 @@ type API struct {
MultiOrgAlertmanager *notifier.MultiOrgAlertmanager
StateManager *state.Manager
SecretsService secrets.Service
AccessControl accesscontrol.AccessControl
}
// RegisterAPIEndpoints registers API handlers