Alerting: Receivers API (read only endpoints) (#81751)
* Add single receiver method * Add receiver permissions * Add single/multi GET endpoints for receivers * Remove stable tag from time intervals See end of PR description here: https://github.com/grafana/grafana/pull/81672
This commit is contained in:
@@ -43,10 +43,27 @@ func (api *API) authorize(method, path string) web.Handler {
|
||||
ac.EvalPermission(ac.ActionAlertingRuleCreate, scope),
|
||||
ac.EvalPermission(ac.ActionAlertingRuleDelete, scope),
|
||||
)
|
||||
// Grafana rule state history paths
|
||||
|
||||
// Grafana rule state history paths
|
||||
case http.MethodGet + "/api/v1/rules/history":
|
||||
eval = ac.EvalPermission(ac.ActionAlertingRuleRead)
|
||||
|
||||
// Grafana receivers paths
|
||||
case http.MethodGet + "/api/v1/notifications/receivers":
|
||||
// additional authorization is done at the service level
|
||||
eval = ac.EvalAny(
|
||||
ac.EvalPermission(ac.ActionAlertingNotificationsRead),
|
||||
ac.EvalPermission(ac.ActionAlertingReceiversList),
|
||||
ac.EvalPermission(ac.ActionAlertingReceiversRead),
|
||||
ac.EvalPermission(ac.ActionAlertingReceiversReadSecrets),
|
||||
)
|
||||
case http.MethodGet + "/api/v1/notifications/receivers/{Name}":
|
||||
// TODO: scope to :Name
|
||||
eval = ac.EvalAny(
|
||||
ac.EvalPermission(ac.ActionAlertingReceiversRead),
|
||||
ac.EvalPermission(ac.ActionAlertingReceiversReadSecrets),
|
||||
)
|
||||
|
||||
// Grafana unified alerting upgrade paths
|
||||
case http.MethodGet + "/api/v1/upgrade/org":
|
||||
return middleware.ReqOrgAdmin
|
||||
|
||||
Reference in New Issue
Block a user