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

Function TestMatcherUsingInOperatorBracket

enforcer_test.go:224–234  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

222}
223
224func TestMatcherUsingInOperatorBracket(t *testing.T) {
225 e, _ := NewEnforcer("examples/rbac_model_matcher_using_in_op_bracket.conf")
226 _, _ = e.AddPermissionForUser("alice", "data1", "read")
227
228 testEnforce(t, e, "alice", "data1", "read", true)
229 testEnforce(t, e, "alice", "data2", "read", true)
230 testEnforce(t, e, "alice", "data3", "read", true)
231 testEnforce(t, e, "anyone", "data1", "read", false)
232 testEnforce(t, e, "anyone", "data2", "read", true)
233 testEnforce(t, e, "anyone", "data3", "read", true)
234}
235
236func TestReloadPolicy(t *testing.T) {
237 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")

Callers

nothing calls this directly

Calls 3

AddPermissionForUserMethod · 0.95
NewEnforcerFunction · 0.85
testEnforceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…