RBAC: Search endpoint support wildcards (#80383)
* RBAC: Search endpoint support wildcards * Allow wildcard filter with RAM permissions as well
This commit is contained in:
@@ -106,8 +106,12 @@ func (s *AccessControlStore) SearchUsersPermissions(ctx context.Context, orgID i
|
||||
params = append(params, options.Action)
|
||||
}
|
||||
if options.Scope != "" {
|
||||
q += ` AND scope = ?`
|
||||
params = append(params, options.Scope)
|
||||
// Search for scope and wildcard that include the scope
|
||||
scopes := append(options.Wildcards(), options.Scope)
|
||||
q += ` AND scope IN ( ? ` + strings.Repeat(", ?", len(scopes)-1) + ")"
|
||||
for i := range scopes {
|
||||
params = append(params, scopes[i])
|
||||
}
|
||||
}
|
||||
|
||||
if options.UserID != 0 {
|
||||
|
||||
Reference in New Issue
Block a user