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

Function testGetImplicitUsersForResourceByDomain

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

Source from the content-addressed store, hash-verified

673}
674
675func testGetImplicitUsersForResourceByDomain(t *testing.T, e *Enforcer, res [][]string, resource string, domain string) {
676 t.Helper()
677 myRes, err := e.GetImplicitUsersForResourceByDomain(resource, domain)
678 if err != nil {
679 panic(err)
680 }
681
682 if !util.Set2DEquals(res, myRes) {
683 t.Error("Implicit users for ", resource, "in domain ", domain, " : ", myRes, ", supposed to be ", res)
684 } else {
685 t.Log("Implicit users for ", resource, "in domain ", domain, " : ", myRes)
686 }
687}
688
689func TestGetImplicitUsersForResourceByDomain(t *testing.T) {
690 e, _ := NewEnforcer("examples/rbac_with_domains_model.conf", "examples/rbac_with_domains_policy.csv")

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…