mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 11:42:20 +08:00
RBAC: remove some IsDisabled
checks (#69272)
* remove some access contorl IsDisabled() checks * cleaning up tests * update tests * linting
This commit is contained in:
@ -135,15 +135,13 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
|
||||
data.CSPContent = middleware.ReplacePolicyVariables(hs.Cfg.CSPTemplate, appURL, c.RequestNonce)
|
||||
}
|
||||
|
||||
if !hs.AccessControl.IsDisabled() {
|
||||
userPermissions, err := hs.accesscontrolService.GetUserPermissions(c.Req.Context(), c.SignedInUser, ac.Options{ReloadCache: false})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
data.User.Permissions = ac.BuildPermissionsMap(userPermissions)
|
||||
userPermissions, err := hs.accesscontrolService.GetUserPermissions(c.Req.Context(), c.SignedInUser, ac.Options{ReloadCache: false})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
data.User.Permissions = ac.BuildPermissionsMap(userPermissions)
|
||||
|
||||
if setting.DisableGravatar {
|
||||
data.User.GravatarUrl = hs.Cfg.AppSubURL + "/public/img/user_profile.png"
|
||||
}
|
||||
|
Reference in New Issue
Block a user