mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 01:42:12 +08:00
teams: viewers and editors can view teams
This commit is contained in:

committed by
Leonard Gram

parent
c420af16b1
commit
782b5b6a3a
@ -87,18 +87,13 @@ func Auth(options *AuthOptions) macaron.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
func EditorCanAdmin(enabled bool) macaron.Handler {
|
||||
func AdminOrCanAdmin(enabled bool) macaron.Handler {
|
||||
return func(c *m.ReqContext) {
|
||||
ok := false
|
||||
if c.OrgRole == m.ROLE_ADMIN {
|
||||
ok = true
|
||||
return
|
||||
}
|
||||
|
||||
if c.OrgRole == m.ROLE_EDITOR && enabled {
|
||||
ok = true
|
||||
}
|
||||
|
||||
if !ok {
|
||||
if !enabled {
|
||||
accessForbidden(c)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user