Fontend handling of account role to hide user actions and links that the user does not have access to

This commit is contained in:
Torkel Ödegaard
2015-01-28 11:33:50 +01:00
parent aa261bbe23
commit 1cff564483
5 changed files with 23 additions and 22 deletions

View File

@@ -70,6 +70,7 @@ func RoleAuth(roles ...m.RoleType) macaron.Handler {
func Auth(options *AuthOptions) macaron.Handler {
return func(c *Context) {
if !c.IsGrafanaAdmin && options.ReqGrafanaAdmin {
c.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+c.Req.RequestURI), 0, setting.AppSubUrl+"/")
authDenied(c)
return
}