MCPcopy Create free account
hub / github.com/apache/casbin / TestGetImplicitUsersForResourceByDomain

Function TestGetImplicitUsersForResourceByDomain

rbac_api_test.go:689–698  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

687}
688
689func TestGetImplicitUsersForResourceByDomain(t *testing.T) {
690 e, _ := NewEnforcer("examples/rbac_with_domains_model.conf", "examples/rbac_with_domains_policy.csv")
691 testGetImplicitUsersForResourceByDomain(t, e, [][]string{{"alice", "domain1", "data1", "read"},
692 {"alice", "domain1", "data1", "write"}}, "data1", "domain1")
693
694 testGetImplicitUsersForResourceByDomain(t, e, [][]string{}, "data2", "domain1")
695
696 testGetImplicitUsersForResourceByDomain(t, e, [][]string{{"bob", "domain2", "data2", "read"},
697 {"bob", "domain2", "data2", "write"}}, "data2", "domain2")
698}
699
700func TestConditional(t *testing.T) {
701 e, _ := NewEnforcer("examples/rbac_with_domains_conditional_model.conf", "examples/rbac_with_domains_conditional_policy.csv")

Callers

nothing calls this directly

Calls 2

NewEnforcerFunction · 0.85

Tested by

no test coverage detected