aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/PermissionsManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-21 13:06:18 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-21 13:06:18 +0500
commit55d91ec7a86777bb0427422c15c2b8a60aa00071 (patch)
tree55d989c8241b18891aa0b479f8e14533cc35d625 /src/org/traccar/database/PermissionsManager.java
parent4b51fef3521e5b0bf338f631ad99e7affe9a1837 (diff)
downloadtrackermap-server-55d91ec7a86777bb0427422c15c2b8a60aa00071.tar.gz
trackermap-server-55d91ec7a86777bb0427422c15c2b8a60aa00071.tar.bz2
trackermap-server-55d91ec7a86777bb0427422c15c2b8a60aa00071.zip
Implement type constants
Diffstat (limited to 'src/org/traccar/database/PermissionsManager.java')
-rw-r--r--src/org/traccar/database/PermissionsManager.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java
index 5f83a1274..56a12e941 100644
--- a/src/org/traccar/database/PermissionsManager.java
+++ b/src/org/traccar/database/PermissionsManager.java
@@ -299,26 +299,26 @@ public class PermissionsManager {
public void checkPermission(String object, long userId, long objectId) throws SecurityException {
SimpleObjectManager manager = null;
- switch (object) {
- case "device":
+ switch (DataManager.makeName(object)) {
+ case Context.TYPE_DEVICE:
checkDevice(userId, objectId);
break;
- case "group":
+ case Context.TYPE_GROUP:
checkGroup(userId, objectId);
break;
- case "user":
+ case Context.TYPE_USER:
checkUser(userId, objectId);
break;
- case "geofence":
+ case Context.TYPE_GEOFENCE:
manager = Context.getGeofenceManager();
break;
- case "attribute":
+ case Context.TYPE_ATTRIBUTE:
manager = Context.getAttributesManager();
break;
- case "driver":
+ case Context.TYPE_DRIVER:
manager = Context.getDriversManager();
break;
- case "calendar":
+ case Context.TYPE_CALENDAR:
manager = Context.getCalendarManager();
break;
default: