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

Function testGetImplicitUsersForResource

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

Source from the content-addressed store, hash-verified

607}
608
609func testGetImplicitUsersForResource(t *testing.T, e *Enforcer, res [][]string, resource string, domain ...string) {
610 t.Helper()
611 myRes, err := e.GetImplicitUsersForResource(resource)
612 if err != nil {
613 panic(err)
614 }
615
616 if !util.Set2DEquals(res, myRes) {
617 t.Error("Implicit users for ", resource, "in domain ", domain, " : ", myRes, ", supposed to be ", res)
618 } else {
619 t.Log("Implicit users for ", resource, "in domain ", domain, " : ", myRes)
620 }
621}
622
623func TestGetImplicitUsersForResource(t *testing.T) {
624 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")

Callers 1

Calls 3

Set2DEqualsFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…