(t *testing.T, e *Enforcer, ptype string, name string, res [][]string, domain ...string)
| 219 | } |
| 220 | |
| 221 | func testGetNamedPermissionsForUser(t *testing.T, e *Enforcer, ptype string, name string, res [][]string, domain ...string) { |
| 222 | t.Helper() |
| 223 | myRes, err := e.GetNamedPermissionsForUser(ptype, name, domain...) |
| 224 | if err != nil { |
| 225 | t.Error(err.Error()) |
| 226 | } |
| 227 | t.Log("Named permissions for ", name, ": ", myRes) |
| 228 | |
| 229 | if !util.Array2DEquals(res, myRes) { |
| 230 | t.Error("Named permissions for ", name, ": ", myRes, ", supposed to be ", res) |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | func TestPermissionAPI(t *testing.T) { |
| 235 | e, _ := NewEnforcer("examples/basic_without_resources_model.conf", "examples/basic_without_resources_policy.csv") |
no test coverage detected
searching dependent graphs…