aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/SimpleObjectManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-24 17:02:39 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-24 17:02:39 +0500
commitaf00329fd0addf84071927dbc18cb0b4e5345f2b (patch)
tree8a8def831332ed70e63544b54c70bcf82e777fbb /src/org/traccar/database/SimpleObjectManager.java
parentd6c7cdf1e103c977ed94b737dc838d7ac22b9fa7 (diff)
downloadtrackermap-server-af00329fd0addf84071927dbc18cb0b4e5345f2b.tar.gz
trackermap-server-af00329fd0addf84071927dbc18cb0b4e5345f2b.tar.bz2
trackermap-server-af00329fd0addf84071927dbc18cb0b4e5345f2b.zip
Use Permission instead of Map
Diffstat (limited to 'src/org/traccar/database/SimpleObjectManager.java')
-rw-r--r--src/org/traccar/database/SimpleObjectManager.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/database/SimpleObjectManager.java b/src/org/traccar/database/SimpleObjectManager.java
index 49ad4707c..031f91fc5 100644
--- a/src/org/traccar/database/SimpleObjectManager.java
+++ b/src/org/traccar/database/SimpleObjectManager.java
@@ -27,6 +27,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.traccar.Context;
import org.traccar.helper.Log;
import org.traccar.model.BaseModel;
+import org.traccar.model.Permission;
import org.traccar.model.User;
public abstract class SimpleObjectManager {
@@ -117,11 +118,10 @@ public abstract class SimpleObjectManager {
if (dataManager != null) {
try {
clearUserItems();
- for (Map<String, Long> permission : dataManager.getPermissions(User.class, baseClass)) {
- getUserItems(permission.get(DataManager.makeNameId(User.class)))
- .add(permission.get(baseClassIdName));
+ for (Permission permission : dataManager.getPermissions(User.class, baseClass)) {
+ getUserItems(permission.getOwnerId()).add(permission.getPropertyId());
}
- } catch (SQLException error) {
+ } catch (SQLException | ClassNotFoundException error) {
Log.warning(error);
}
}