final Scope ns,
final HttpServletRequest request) {
if (!ns.allows(resourceType, new HttpAccess(Operation.LIST, request))) return FORBIDDEN;
final MapStreamer streamer = new MapStreamer(ns.resourceMap(resourceType));
return Response.ok(
new StreamingOutput() {
@Override
public void write(OutputStream output) throws IOException, WebApplicationException {
streamer.write(output);
}
},
MediaType.APPLICATION_JSON
).build();
}