mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
9256ca371d
commit
db0be6bc95
@ -203,16 +203,20 @@ func (f AccessControlDashboardPermissionFilter) Where() (string, []interface{})
|
|||||||
|
|
||||||
func actionsToCheck(actions []string, permissions map[string][]string, wildcards ...accesscontrol.Wildcards) []interface{} {
|
func actionsToCheck(actions []string, permissions map[string][]string, wildcards ...accesscontrol.Wildcards) []interface{} {
|
||||||
toCheck := make([]interface{}, 0, len(actions))
|
toCheck := make([]interface{}, 0, len(actions))
|
||||||
|
|
||||||
for _, a := range actions {
|
for _, a := range actions {
|
||||||
var hasWildcard bool
|
var hasWildcard bool
|
||||||
|
|
||||||
|
outer:
|
||||||
for _, scope := range permissions[a] {
|
for _, scope := range permissions[a] {
|
||||||
for _, w := range wildcards {
|
for _, w := range wildcards {
|
||||||
if w.Contains(scope) {
|
if w.Contains(scope) {
|
||||||
hasWildcard = true
|
hasWildcard = true
|
||||||
break
|
break outer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !hasWildcard {
|
if !hasWildcard {
|
||||||
toCheck = append(toCheck, a)
|
toCheck = append(toCheck, a)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user