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

Function testEnforce

model_test.go:26–33  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, sub interface{}, obj interface{}, act string, res bool)

Source from the content-addressed store, hash-verified

24)
25
26func testEnforce(t *testing.T, e *Enforcer, sub interface{}, obj interface{}, act string, res bool) {
27 t.Helper()
28 if myRes, err := e.Enforce(sub, obj, act); err != nil {
29 t.Errorf("Enforce Error: %s", err)
30 } else if myRes != res {
31 t.Errorf("%s, %v, %s: %t, supposed to be %t", sub, obj, act, myRes, res)
32 }
33}
34
35func testEnforceWithoutUsers(t *testing.T, e *Enforcer, obj string, act string, res bool) {
36 t.Helper()

Callers 15

TestSyntaxMatcherFunction · 0.85
TestABACModelFunction · 0.85
TestABACMapRequestFunction · 0.85
TestABACTypesFunction · 0.85
TestABACJsonRequestFunction · 0.85
TestABACNotUsingPolicyFunction · 0.85
TestABACPolicyFunction · 0.85
TestRBACModelInMemoryFunction · 0.85
TestRBACModelInMemory2Function · 0.85

Calls 1

EnforceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…