aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/PermissionsManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-06-10 16:02:06 +0500
committerAbyss777 <abyss@fox5.ru>2016-06-10 16:02:06 +0500
commit41fe4ca770875842f4d17531506c4bc74dc90501 (patch)
treed8cdfbf19873d8dd4ae100887b0cec5134f5eb74 /src/org/traccar/database/PermissionsManager.java
parente966778c43ee4a2fa12705cded8648b96ef78f61 (diff)
downloadtrackermap-server-41fe4ca770875842f4d17531506c4bc74dc90501.tar.gz
trackermap-server-41fe4ca770875842f4d17531506c4bc74dc90501.tar.bz2
trackermap-server-41fe4ca770875842f4d17531506c4bc74dc90501.zip
Geofences
Diffstat (limited to 'src/org/traccar/database/PermissionsManager.java')
-rw-r--r--src/org/traccar/database/PermissionsManager.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java
index 08d44b382..96a6488ef 100644
--- a/src/org/traccar/database/PermissionsManager.java
+++ b/src/org/traccar/database/PermissionsManager.java
@@ -15,6 +15,7 @@
*/
package org.traccar.database;
+import org.traccar.Context;
import org.traccar.helper.Log;
import org.traccar.model.Device;
import org.traccar.model.DevicePermission;
@@ -145,4 +146,10 @@ public class PermissionsManager {
}
}
+ public void checkGeofence(long userId, long geofenceId) throws SecurityException {
+ if (!Context.getGeofenceManager().checkGeofence(userId, geofenceId) && !isAdmin(userId)) {
+ throw new SecurityException("Geofence access denied");
+ }
+ }
+
}