mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Auth: reduce allocs (#55410)
This commit is contained in:
parent
10b3c0787a
commit
13146cc812
@ -173,8 +173,8 @@ func BuildPermissionsMap(permissions []Permission) map[string]bool {
|
|||||||
// GroupScopesByAction will group scopes on action
|
// GroupScopesByAction will group scopes on action
|
||||||
func GroupScopesByAction(permissions []Permission) map[string][]string {
|
func GroupScopesByAction(permissions []Permission) map[string][]string {
|
||||||
m := make(map[string][]string)
|
m := make(map[string][]string)
|
||||||
for _, p := range permissions {
|
for i := range permissions {
|
||||||
m[p.Action] = append(m[p.Action], p.Scope)
|
m[permissions[i].Action] = append(m[permissions[i].Action], permissions[i].Scope)
|
||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user