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

Function TestInitFilteredAdapter

filter_test.go:24–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22)
23
24func TestInitFilteredAdapter(t *testing.T) {
25 e, _ := NewEnforcer()
26
27 adapter := fileadapter.NewFilteredAdapter("examples/rbac_with_domains_policy.csv")
28 _ = e.InitWithAdapter("examples/rbac_with_domains_model.conf", adapter)
29
30 // policy should not be loaded yet
31 testHasPolicy(t, e, []string{"admin", "domain1", "data1", "read"}, false)
32}
33
34func TestLoadFilteredPolicy(t *testing.T) {
35 e, _ := NewEnforcer()

Callers

nothing calls this directly

Calls 3

InitWithAdapterMethod · 0.95
NewEnforcerFunction · 0.85
testHasPolicyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…