mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 21:43:09 +08:00
teams: better names for api permissions.
This commit is contained in:
@ -87,7 +87,12 @@ func Auth(options *AuthOptions) macaron.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
func AdminOrCanAdmin(enabled bool) macaron.Handler {
|
||||
// AdminOrFeatureEnabled creates a middleware that allows access
|
||||
// if the signed in user is either an Org Admin or if the
|
||||
// feature flag is enabled.
|
||||
// Intended for when feature flags open up access to APIs that
|
||||
// are otherwise only available to admins.
|
||||
func AdminOrFeatureEnabled(enabled bool) macaron.Handler {
|
||||
return func(c *m.ReqContext) {
|
||||
if c.OrgRole == m.ROLE_ADMIN {
|
||||
return
|
||||
|
Reference in New Issue
Block a user