Alerting: Let users with regular permissions access export endpoints (#76082)

let users with regular permissions access export endpoints
This commit is contained in:
Yuri Tseretyan 2023-10-06 14:48:20 -04:00 committed by GitHub
parent 095749b131
commit 0a50ca7231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,10 +189,16 @@ func (api *API) authorize(method, path string) web.Handler {
return middleware.ReqOrgAdmin
// Grafana-only Provisioning Read Paths
case http.MethodGet + "/api/v1/provisioning/policies/export",
http.MethodGet + "/api/v1/provisioning/contact-points/export":
eval = ac.EvalAny(
ac.EvalPermission(ac.ActionAlertingNotificationsRead), // organization scope
ac.EvalPermission(ac.ActionAlertingProvisioningRead), // organization scope
ac.EvalPermission(ac.ActionAlertingProvisioningReadSecrets), // organization scope
)
case http.MethodGet + "/api/v1/provisioning/policies",
http.MethodGet + "/api/v1/provisioning/policies/export",
http.MethodGet + "/api/v1/provisioning/contact-points",
http.MethodGet + "/api/v1/provisioning/contact-points/export",
http.MethodGet + "/api/v1/provisioning/templates",
http.MethodGet + "/api/v1/provisioning/templates/{name}",
http.MethodGet + "/api/v1/provisioning/mute-timings",