diff options
author | Abyss777 <abyss@fox5.ru> | 2017-07-20 08:56:29 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-07-20 09:52:27 +0500 |
commit | afb9a199f57824ec06c993b6028c35b616f64885 (patch) | |
tree | 1ab2531846dc1ff4c9b5e0d6d71ebcec231aff89 /src/org/traccar/api/resource/UserResource.java | |
parent | a9478ded48de140d47d17def1ee5329267fe6088 (diff) | |
download | trackermap-server-afb9a199f57824ec06c993b6028c35b616f64885.tar.gz trackermap-server-afb9a199f57824ec06c993b6028c35b616f64885.tar.bz2 trackermap-server-afb9a199f57824ec06c993b6028c35b616f64885.zip |
Combine permission resources and reuse common database functions
Diffstat (limited to 'src/org/traccar/api/resource/UserResource.java')
-rw-r--r-- | src/org/traccar/api/resource/UserResource.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java index b9187fdbb..94cc56b47 100644 --- a/src/org/traccar/api/resource/UserResource.java +++ b/src/org/traccar/api/resource/UserResource.java @@ -34,6 +34,7 @@ import javax.ws.rs.core.Response; import java.sql.SQLException; import java.util.Collection; import java.util.Date; +import java.util.LinkedHashMap; @Path("users") @Produces(MediaType.APPLICATION_JSON) @@ -74,7 +75,10 @@ public class UserResource extends BaseResource { } Context.getPermissionsManager().addUser(entity); if (Context.getPermissionsManager().isManager(getUserId())) { - Context.getDataManager().linkUser(getUserId(), entity.getId()); + LinkedHashMap<String, Long> link = new LinkedHashMap<>(); + link.put("userId", getUserId()); + link.put("managedUserId", entity.getId()); + Context.getDataManager().linkObject(link, true); } Context.getPermissionsManager().refreshUserPermissions(); if (Context.getNotificationManager() != null) { |