* add FGAC actions for silences table
* redirect users without permissions
* add permissions checks to routes
* add fgac to notifications and contact points
* fgac for notification policies
* fix mute timing authorization
* use consistent naming for checking grafana alertmanager
* tests for fgac in contact points and notification policies
* bump up timeout on rule editor test
* use new permissions util
* break out route evaluation into util
* Remove test timeout
* Change permissions for the alert-notifiers endpoint
* Use signed in handler for alert-notifiers when unified alerting enabled
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
(cherry picked from commit 49505b9a3b)
Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
This commit is contained in:
co-authored by
Nathan Rodman
parent
50712b5782
commit
8280aa5636
+9
-1
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/web"
|
||||
)
|
||||
|
||||
var plog = log.New("api")
|
||||
@@ -417,7 +418,14 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
alertsRoute.Get("/states-for-dashboard", routing.Wrap(hs.GetAlertStatesForDashboard))
|
||||
})
|
||||
|
||||
apiRoute.Get("/alert-notifiers", reqEditorRole, routing.Wrap(
|
||||
var notifiersAuthHandler web.Handler
|
||||
if hs.Cfg.UnifiedAlerting.IsEnabled() {
|
||||
notifiersAuthHandler = reqSignedIn
|
||||
} else {
|
||||
notifiersAuthHandler = reqEditorRole
|
||||
}
|
||||
|
||||
apiRoute.Get("/alert-notifiers", notifiersAuthHandler, routing.Wrap(
|
||||
hs.GetAlertNotifiers(hs.Cfg.UnifiedAlerting.IsEnabled())),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user