MCPcopy Index your code
hub / github.com/apache/casbin / testGetImplicitRolesInDomain

Function testGetImplicitRolesInDomain

rbac_api_test.go:300–308  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, name string, domain string, res []string)

Source from the content-addressed store, hash-verified

298}
299
300func testGetImplicitRolesInDomain(t *testing.T, e *Enforcer, name string, domain string, res []string) {
301 t.Helper()
302 myRes, _ := e.GetImplicitRolesForUser(name, domain)
303 t.Log("Implicit roles in domain ", domain, " for ", name, ": ", myRes)
304
305 if !util.SetEquals(res, myRes) {
306 t.Error("Implicit roles in domain ", domain, " for ", name, ": ", myRes, ", supposed to be ", res)
307 }
308}
309
310func TestImplicitRoleAPI(t *testing.T) {
311 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_with_hierarchy_policy.csv")

Callers 2

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…