aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DataManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-21 09:59:27 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-21 09:59:27 +0500
commit839e741653c9b61e573fa1cdd0dad0641c79bcec (patch)
tree69ef63138122eb0d8cdebe38f678e1d0e2ff82df /src/org/traccar/database/DataManager.java
parente00fbfa466b17e94f59e6ff8fefb83f08999b3ec (diff)
downloadtrackermap-server-839e741653c9b61e573fa1cdd0dad0641c79bcec.tar.gz
trackermap-server-839e741653c9b61e573fa1cdd0dad0641c79bcec.tar.bz2
trackermap-server-839e741653c9b61e573fa1cdd0dad0641c79bcec.zip
Abolish permissions classes and get permissions as Map from DB
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r--src/org/traccar/database/DataManager.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 7497294a1..39ffe6552 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -285,6 +285,14 @@ public class DataManager {
return QueryBuilder.create(dataSource, getQuery(query)).executeQuery(clazz);
}
+ public Collection<Map<String, Long>> getPermissions(String owner, String property) throws SQLException {
+ String query = "database.select"
+ + owner.substring(0, 1).toUpperCase() + owner.substring(1)
+ + property.substring(0, 1).toUpperCase() + property.substring(1)
+ + "s";
+ return QueryBuilder.create(dataSource, getQuery(query)).executeMapQuery(Long.class);
+ }
+
public void addObject(BaseModel entity) throws SQLException {
String query = "database.insert" + entity.getClass().getSimpleName();
entity.setId(QueryBuilder.create(dataSource, getQuery(query), true)