(t *testing.T, e *Enforcer, name string, permission []string, res bool)
| 205 | } |
| 206 | |
| 207 | func testHasPermission(t *testing.T, e *Enforcer, name string, permission []string, res bool) { |
| 208 | t.Helper() |
| 209 | myRes, err := e.HasPermissionForUser(name, permission...) |
| 210 | if err != nil { |
| 211 | t.Error(err.Error()) |
| 212 | } |
| 213 | |
| 214 | t.Log(name, " has permission ", util.ArrayToString(permission), ": ", myRes) |
| 215 | |
| 216 | if res != myRes { |
| 217 | t.Error(name, " has permission ", util.ArrayToString(permission), ": ", myRes, ", supposed to be ", res) |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | func testGetNamedPermissionsForUser(t *testing.T, e *Enforcer, ptype string, name string, res [][]string, domain ...string) { |
| 222 | t.Helper() |
no test coverage detected
searching dependent graphs…