Use split scopes instead of substr in search v1 (#82092)

* use split scopes instead of substr in search v1

* tests, of course

* yet, some test helpers dont use split scopes

* another test helper to fix

* add permission.identifier to group by

* check if attribute is uid

* fix tests

* use SplitScope()

* fix more tests
This commit is contained in:
Serge Zaitsev
2024-02-18 22:26:08 +01:00
committed by GitHub
parent 94a274635b
commit 1aff748e8f
5 changed files with 49 additions and 47 deletions

View File

@@ -116,7 +116,7 @@ func AddUserPermissionToDB(t testing.TB, db db.DB, user *user.SignedInUser) {
p := accesscontrol.Permission{
RoleID: role.ID, Action: action, Scope: scope, Created: time.Now(), Updated: time.Now(),
}
//p.Kind, p.Attribute, p.Identifier = p.SplitScope()
p.Kind, p.Attribute, p.Identifier = p.SplitScope()
permissions = append(permissions, p)
}