aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/EventResource.java
diff options
context:
space:
mode:
authorRenaud Allard <renaud@allard.it>2016-10-20 08:31:57 +0200
committerRenaud Allard <renaud@allard.it>2016-10-20 08:31:57 +0200
commit1104c2738e19579c5865db5c030388e1e320f0b4 (patch)
treea6571455b6f5d88581c8034bd1059968d506ed01 /src/org/traccar/api/resource/EventResource.java
parent0d347cd7aac2ebfad01c1635f3893964be2e67ae (diff)
parent4f7356cc1c6962f46ca522246d5b63dc06a2d268 (diff)
downloadtrackermap-server-1104c2738e19579c5865db5c030388e1e320f0b4.tar.gz
trackermap-server-1104c2738e19579c5865db5c030388e1e320f0b4.tar.bz2
trackermap-server-1104c2738e19579c5865db5c030388e1e320f0b4.zip
Merge branch 'master' of https://github.com/tananaev/traccar
Diffstat (limited to 'src/org/traccar/api/resource/EventResource.java')
-rw-r--r--src/org/traccar/api/resource/EventResource.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/org/traccar/api/resource/EventResource.java b/src/org/traccar/api/resource/EventResource.java
index 74a748ea5..c0a8f968d 100644
--- a/src/org/traccar/api/resource/EventResource.java
+++ b/src/org/traccar/api/resource/EventResource.java
@@ -1,14 +1,12 @@
package org.traccar.api.resource;
import java.sql.SQLException;
-import java.util.Collection;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.traccar.Context;
@@ -26,14 +24,9 @@ public class EventResource extends BaseResource {
public Event get(@PathParam("id") long id) throws SQLException {
Event event = Context.getDataManager().getEvent(id);
Context.getPermissionsManager().checkDevice(getUserId(), event.getDeviceId());
+ if (event.getGeofenceId() != 0) {
+ Context.getPermissionsManager().checkGeofence(getUserId(), event.getGeofenceId());
+ }
return event;
}
-
- @GET
- public Collection<Event> get(
- @QueryParam("deviceId") long deviceId, @QueryParam("type") String type,
- @QueryParam("interval") int interval) throws SQLException {
- Context.getPermissionsManager().checkDevice(getUserId(), deviceId);
- return Context.getDataManager().getLastEvents(deviceId, type, interval);
- }
}