(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestABACModel(t *testing.T) { |
| 38 | e, _ := NewEnforcer("examples/abac_model.conf") |
| 39 | |
| 40 | data1 := newTestResource("data1", "alice") |
| 41 | data2 := newTestResource("data2", "bob") |
| 42 | |
| 43 | testEnforce(t, e, "alice", data1, "read", true) |
| 44 | testEnforce(t, e, "alice", data1, "write", true) |
| 45 | testEnforce(t, e, "alice", data2, "read", false) |
| 46 | testEnforce(t, e, "alice", data2, "write", false) |
| 47 | testEnforce(t, e, "bob", data1, "read", false) |
| 48 | testEnforce(t, e, "bob", data1, "write", false) |
| 49 | testEnforce(t, e, "bob", data2, "read", true) |
| 50 | testEnforce(t, e, "bob", data2, "write", true) |
| 51 | } |
| 52 | |
| 53 | func TestABACMapRequest(t *testing.T) { |
| 54 | e, _ := NewEnforcer("examples/abac_model.conf") |
nothing calls this directly
no test coverage detected
searching dependent graphs…