mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
NGAlerting: Use identity.Requester interface instead of SignedInUser (#76360)
* unfurl SignedInUserAttrs services * replace signedInUser with Requester replace signedInUser with requester * fix tests * linting --------- Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
@@ -44,7 +44,7 @@ func (srv ConfigSrv) RouteGetAlertmanagers(c *contextmodel.ReqContext) response.
|
||||
}
|
||||
|
||||
func (srv ConfigSrv) RouteGetNGalertConfig(c *contextmodel.ReqContext) response.Response {
|
||||
if c.OrgRole != org.RoleAdmin {
|
||||
if c.SignedInUser.GetOrgRole() != org.RoleAdmin {
|
||||
return accessForbiddenResp()
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ func (srv ConfigSrv) RouteGetNGalertConfig(c *contextmodel.ReqContext) response.
|
||||
}
|
||||
|
||||
func (srv ConfigSrv) RoutePostNGalertConfig(c *contextmodel.ReqContext, body apimodels.PostableNGalertConfig) response.Response {
|
||||
if c.OrgRole != org.RoleAdmin {
|
||||
if c.SignedInUser.GetOrgRole() != org.RoleAdmin {
|
||||
return accessForbiddenResp()
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ func (srv ConfigSrv) RoutePostNGalertConfig(c *contextmodel.ReqContext, body api
|
||||
}
|
||||
|
||||
func (srv ConfigSrv) RouteDeleteNGalertConfig(c *contextmodel.ReqContext) response.Response {
|
||||
if c.OrgRole != org.RoleAdmin {
|
||||
if c.SignedInUser.GetOrgRole() != org.RoleAdmin {
|
||||
return accessForbiddenResp()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user