RBAC: Search endpoint support wildcards (#80383)
* RBAC: Search endpoint support wildcards * Allow wildcard filter with RAM permissions as well
This commit is contained in:
@@ -448,6 +448,23 @@ func TestService_SearchUsersPermissions(t *testing.T) {
|
||||
{Action: accesscontrol.ActionTeamsPermissionsRead, Scope: "teams:*"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ram only search on scope",
|
||||
siuPermissions: listAllPerms,
|
||||
searchOption: accesscontrol.SearchOptions{Scope: "teams:id:2"},
|
||||
ramRoles: map[string]*accesscontrol.RoleDTO{
|
||||
string(roletype.RoleAdmin): {Permissions: []accesscontrol.Permission{
|
||||
{Action: accesscontrol.ActionTeamsRead, Scope: "teams:*"},
|
||||
}},
|
||||
},
|
||||
storedRoles: map[int64][]string{
|
||||
1: {string(roletype.RoleEditor)},
|
||||
2: {string(roletype.RoleAdmin), accesscontrol.RoleGrafanaAdmin},
|
||||
},
|
||||
want: map[int64][]accesscontrol.Permission{
|
||||
2: {{Action: accesscontrol.ActionTeamsRead, Scope: "teams:*"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "view permission on subset of users only",
|
||||
siuPermissions: listSomePerms,
|
||||
|
||||
Reference in New Issue
Block a user