MCPcopy
hub / github.com/apache/casbin / TestABACNotUsingPolicy

Function TestABACNotUsingPolicy

abac_test.go:162–171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

160}
161
162func TestABACNotUsingPolicy(t *testing.T) {
163 e, _ := NewEnforcer("examples/abac_not_using_policy_model.conf", "examples/abac_rule_effect_policy.csv")
164 data1 := newTestResource("data1", "alice")
165 data2 := newTestResource("data2", "bob")
166
167 testEnforce(t, e, "alice", data1, "read", true)
168 testEnforce(t, e, "alice", data1, "write", true)
169 testEnforce(t, e, "alice", data2, "read", false)
170 testEnforce(t, e, "alice", data2, "write", false)
171}
172
173func TestABACPolicy(t *testing.T) {
174 e, _ := NewEnforcer("examples/abac_rule_model.conf", "examples/abac_rule_policy.csv")

Callers

nothing calls this directly

Calls 3

NewEnforcerFunction · 0.85
newTestResourceFunction · 0.85
testEnforceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…