(t *testing.T)
| 549 | } |
| 550 | |
| 551 | func TestMultiplePolicyDefinitions(t *testing.T) { |
| 552 | e, _ := NewEnforcer("examples/multiple_policy_definitions_model.conf", "examples/multiple_policy_definitions_policy.csv") |
| 553 | enforceContext := NewEnforceContext("2") |
| 554 | enforceContext.EType = "e" |
| 555 | testBatchEnforce(t, e, [][]interface{}{ |
| 556 | {"alice", "data2", "read"}, |
| 557 | {enforceContext, struct{ Age int }{Age: 70}, "/data1", "read"}, |
| 558 | {enforceContext, struct{ Age int }{Age: 30}, "/data1", "read"}, |
| 559 | }, []bool{ |
| 560 | true, false, true, |
| 561 | }) |
| 562 | } |
| 563 | |
| 564 | func TestPriorityExplicit(t *testing.T) { |
| 565 | e, _ := NewEnforcer("examples/priority_model_explicit.conf", "examples/priority_policy_explicit.csv") |
nothing calls this directly
no test coverage detected
searching dependent graphs…