diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-02 18:51:34 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-02 18:51:34 +1200 |
commit | af72af207613c80b8d66814d30644e4228e9b9e6 (patch) | |
tree | 56409810df0967976dce60799180fbee41e82439 /src/org/traccar/database/PermissionsManager.java | |
parent | 44da47950bdd75be57714158fd8a6d59c94460b5 (diff) | |
download | trackermap-server-af72af207613c80b8d66814d30644e4228e9b9e6.tar.gz trackermap-server-af72af207613c80b8d66814d30644e4228e9b9e6.tar.bz2 trackermap-server-af72af207613c80b8d66814d30644e4228e9b9e6.zip |
Refactor data manager code
Diffstat (limited to 'src/org/traccar/database/PermissionsManager.java')
-rw-r--r-- | src/org/traccar/database/PermissionsManager.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java index 16ddd336d..e889afb06 100644 --- a/src/org/traccar/database/PermissionsManager.java +++ b/src/org/traccar/database/PermissionsManager.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.Set; import org.traccar.Context; import org.traccar.helper.Log; +import org.traccar.model.Permission; public class PermissionsManager { @@ -42,8 +43,8 @@ public class PermissionsManager { public final void refresh() { permissions.clear(); try { - for (Map.Entry<Long, Long> entry : Context.getDataManager().getPermissions()) { - getNotNull(entry.getKey()).add(entry.getValue()); + for (Permission permission : Context.getDataManager().getPermissions()) { + getNotNull(permission.getUserId()).add(permission.getDeviceId()); } } catch (SQLException error) { Log.warning(error); |