mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 17:49:40 +00:00
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:
1 parent
a60be3850a
commit
ef42a0cf76
1 file changed
+3
-1
+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();
|
||||
|
||||
Reference in new issue
Block a user