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

Function testEnforceLBAC

lbac_test.go:21–28  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, sub string, subConf, subInteg float64, obj string, objConf, objInteg float64, act string, res bool)

Source from the content-addressed store, hash-verified

19)
20
21func testEnforceLBAC(t *testing.T, e *Enforcer, sub string, subConf, subInteg float64, obj string, objConf, objInteg float64, act string, res bool) {
22 t.Helper()
23 if myRes, err := e.Enforce(sub, subConf, subInteg, obj, objConf, objInteg, act); err != nil {
24 t.Errorf("Enforce Error: %s", err)
25 } else if myRes != res {
26 t.Errorf("%s, conf=%v, integ=%v, %s, conf=%v, integ=%v, %s: %t, supposed to be %t", sub, subConf, subInteg, obj, objConf, objInteg, act, myRes, res)
27 }
28}
29
30func TestLBACModel(t *testing.T) {
31 e, _ := NewEnforcer("examples/lbac_model.conf")

Callers 1

TestLBACModelFunction · 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…