expose only public events by default in the /events REST service. Queries for specific IDs will be satisfied regardless the publicness

This commit is contained in:
Axel Uhl committed 2014-05-19 15:48:15 +02:00
1 parent a60be3850a
commit ef42a0cf76
1 file changed
+3 -1
@@ -34,7 +34,9 @@ public class EventsResource extends AbstractSailingServerResource {
JsonSerializer<EventBase> eventSerializer = new EventJsonSerializer(new VenueJsonSerializer(new CourseAreaJsonSerializer()));
JSONArray result = new JSONArray();
for (EventBase event : getService().getAllEvents()) {
result.add(eventSerializer.serialize(event));
if (event.isPublic()) {
result.add(eventSerializer.serialize(event));
}
}
String json = result.toJSONString();
return Response.ok(json, MediaType.APPLICATION_JSON).build();