(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func TestABACMapRequest(t *testing.T) { |
| 54 | e, _ := NewEnforcer("examples/abac_model.conf") |
| 55 | |
| 56 | data1 := map[string]interface{}{ |
| 57 | "Name": "data1", |
| 58 | "Owner": "alice", |
| 59 | } |
| 60 | data2 := map[string]interface{}{ |
| 61 | "Name": "data2", |
| 62 | "Owner": "bob", |
| 63 | } |
| 64 | |
| 65 | testEnforce(t, e, "alice", data1, "read", true) |
| 66 | testEnforce(t, e, "alice", data1, "write", true) |
| 67 | testEnforce(t, e, "alice", data2, "read", false) |
| 68 | testEnforce(t, e, "alice", data2, "write", false) |
| 69 | testEnforce(t, e, "bob", data1, "read", false) |
| 70 | testEnforce(t, e, "bob", data1, "write", false) |
| 71 | testEnforce(t, e, "bob", data2, "read", true) |
| 72 | testEnforce(t, e, "bob", data2, "write", true) |
| 73 | } |
| 74 | |
| 75 | func TestABACTypes(t *testing.T) { |
| 76 | e, _ := NewEnforcer("examples/abac_model.conf") |
nothing calls this directly
no test coverage detected
searching dependent graphs…