aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DataManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-13 17:36:31 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-13 17:36:31 +1200
commitfc75fe4ab4f8ea9de58c41772fdd92c10c73f2bc (patch)
tree9418ef08d1b5d8858922b90e4c0b9e2f1747b2ee /src/org/traccar/database/DataManager.java
parentbd4c32abced2bb654b64a2042668340167d6b191 (diff)
downloadtrackermap-server-fc75fe4ab4f8ea9de58c41772fdd92c10c73f2bc.tar.gz
trackermap-server-fc75fe4ab4f8ea9de58c41772fdd92c10c73f2bc.tar.bz2
trackermap-server-fc75fe4ab4f8ea9de58c41772fdd92c10c73f2bc.zip
Fix API access permissions
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r--src/org/traccar/database/DataManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index dd611d975..bab785a96 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -50,7 +50,7 @@ public class DataManager {
private final Properties properties;
private DataSource dataSource;
-
+
private final Map<String, Device> devices = new HashMap<String, Device>();
private long devicesLastUpdate;
private long devicesRefreshDelay;
@@ -231,6 +231,7 @@ public class DataManager {
user.setId(QueryBuilder.create(dataSource, properties.getProperty("database.insertUser"))
.setObject(user)
.executeUpdate());
+ Context.getPermissionsManager().refresh();
}
public void updateUser(User user) throws SQLException {
@@ -243,12 +244,15 @@ public class DataManager {
.setObject(user)
.executeUpdate();
}
+
+ Context.getPermissionsManager().refresh();
}
public void removeUser(User user) throws SQLException {
QueryBuilder.create(dataSource, properties.getProperty("database.deleteUser"))
.setObject(user)
.executeUpdate();
+ Context.getPermissionsManager().refresh();
}
public Collection<Permission> getPermissions() throws SQLException {
@@ -290,6 +294,7 @@ public class DataManager {
.setLong("userId", userId)
.setLong("deviceId", deviceId)
.executeUpdate();
+ Context.getPermissionsManager().refresh();
}
public Collection<Position> getPositions(long userId, long deviceId, Date from, Date to) throws SQLException {