Big refactoring for context.User, and how current user info is fetching, now included collaborator role

This commit is contained in:
Torkel Ödegaard
2015-01-16 14:32:18 +01:00
parent 52992928d5
commit 22156fe309
17 changed files with 169 additions and 105 deletions

View File

@ -13,8 +13,8 @@ import (
)
type AuthOptions struct {
ReqAdmin bool
ReqSignedIn bool
ReqGrafanaAdmin bool
ReqSignedIn bool
}
func getRequestAccountId(c *Context) (int64, error) {
@ -68,7 +68,7 @@ func Auth(options *AuthOptions) macaron.Handler {
return
}
if !c.IsAdmin && options.ReqAdmin {
if !c.IsGrafanaAdmin && options.ReqGrafanaAdmin {
authDenied(c)
return
}