(t *testing.T)
| 684 | } |
| 685 | |
| 686 | func TestAllMatchModel(t *testing.T) { |
| 687 | e, _ := NewEnforcer("examples/rbac_with_all_pattern_model.conf", "examples/rbac_with_all_pattern_policy.csv") |
| 688 | e.AddNamedMatchingFunc("g", "keyMatch2", util.KeyMatch2) |
| 689 | e.AddNamedDomainMatchingFunc("g", "keyMatch2", util.KeyMatch2) |
| 690 | |
| 691 | testDomainEnforce(t, e, "alice", "domain1", "/book/1", "read", true) |
| 692 | testDomainEnforce(t, e, "alice", "domain1", "/book/1", "write", false) |
| 693 | testDomainEnforce(t, e, "alice", "domain2", "/book/1", "read", false) |
| 694 | testDomainEnforce(t, e, "alice", "domain2", "/book/1", "write", true) |
| 695 | } |
| 696 | |
| 697 | func TestTemporalRolesModel(t *testing.T) { |
| 698 | e, _ := NewEnforcer("examples/rbac_with_temporal_roles_model.conf", "examples/rbac_with_temporal_roles_policy.csv") |
nothing calls this directly
no test coverage detected
searching dependent graphs…