MCPcopy
hub / github.com/apache/casbin / testGetUsersInDomain

Function testGetUsersInDomain

rbac_api_with_domains_test.go:25–33  ·  view source on GitHub ↗

testGetUsersInDomain: Add by Gordon.

(t *testing.T, e *Enforcer, name string, domain string, res []string)

Source from the content-addressed store, hash-verified

23
24// testGetUsersInDomain: Add by Gordon.
25func testGetUsersInDomain(t *testing.T, e *Enforcer, name string, domain string, res []string) {
26 t.Helper()
27 myRes := e.GetUsersForRoleInDomain(name, domain)
28 t.Log("Users for ", name, " under ", domain, ": ", myRes)
29
30 if !util.SetEquals(res, myRes) {
31 t.Error("Users for ", name, " under ", domain, ": ", myRes, ", supposed to be ", res)
32 }
33}
34
35func testGetRolesInDomain(t *testing.T, e *Enforcer, name string, domain string, res []string) {
36 t.Helper()

Callers 2

TestUserAPIWithDomainsFunction · 0.85
TestConditionalFunction · 0.85

Calls 3

SetEqualsFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…