(t *testing.T)
| 607 | } |
| 608 | |
| 609 | func TestReloadPolicyWithFunc(t *testing.T) { |
| 610 | e, _ := NewEnforcer("examples/rbac_with_pattern_model.conf", "examples/rbac_with_pattern_policy.csv") |
| 611 | e.AddNamedMatchingFunc("g2", "matchingFunc", util.KeyMatch2) |
| 612 | testEnforce(t, e, "alice", "/book/1", "GET", true) |
| 613 | testEnforce(t, e, "bob", "/pen/3", "GET", true) |
| 614 | _ = e.LoadPolicy() |
| 615 | testEnforce(t, e, "alice", "/book/1", "GET", true) |
| 616 | testEnforce(t, e, "bob", "/pen/3", "GET", true) |
| 617 | } |
| 618 | |
| 619 | func TestEvalPriority(t *testing.T) { |
| 620 | e, _ := NewEnforcer("examples/eval_operator_model.conf", "examples/eval_operator_policy.csv") |
nothing calls this directly
no test coverage detected