diff options
author | Abyss777 <abyss@fox5.ru> | 2016-08-23 14:48:01 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-08-23 14:48:01 +0500 |
commit | 21bf1014e55ab8049e18ee991c6ee80b23d1789c (patch) | |
tree | 1b69c9e0e303773fc5d85958ac6bd369471b9637 /src/org/traccar/api/resource/UserResource.java | |
parent | 5536fbe00c022c151007ad077d911b5162201cd4 (diff) | |
download | trackermap-server-21bf1014e55ab8049e18ee991c6ee80b23d1789c.tar.gz trackermap-server-21bf1014e55ab8049e18ee991c6ee80b23d1789c.tar.bz2 trackermap-server-21bf1014e55ab8049e18ee991c6ee80b23d1789c.zip |
Implement cache for users objects
Diffstat (limited to 'src/org/traccar/api/resource/UserResource.java')
-rw-r--r-- | src/org/traccar/api/resource/UserResource.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java index da72c7f47..2d187fe9d 100644 --- a/src/org/traccar/api/resource/UserResource.java +++ b/src/org/traccar/api/resource/UserResource.java @@ -41,7 +41,7 @@ public class UserResource extends BaseResource { @GET public Collection<User> get() throws SQLException { Context.getPermissionsManager().checkAdmin(getUserId()); - return Context.getDataManager().getUsers(); + return Context.getPermissionsManager().getUsers(); } @PermitAll @@ -50,8 +50,7 @@ public class UserResource extends BaseResource { if (!Context.getPermissionsManager().isAdmin(getUserId())) { Context.getPermissionsManager().checkRegistration(getUserId()); } - Context.getDataManager().addUser(entity); - Context.getPermissionsManager().refresh(); + Context.getPermissionsManager().addUser(entity); if (Context.getNotificationManager() != null) { Context.getNotificationManager().refresh(); } @@ -66,8 +65,7 @@ public class UserResource extends BaseResource { } else { Context.getPermissionsManager().checkUser(getUserId(), entity.getId()); } - Context.getDataManager().updateUser(entity); - Context.getPermissionsManager().refresh(); + Context.getPermissionsManager().updateUser(entity); if (Context.getNotificationManager() != null) { Context.getNotificationManager().refresh(); } @@ -78,8 +76,7 @@ public class UserResource extends BaseResource { @DELETE public Response remove(@PathParam("id") long id) throws SQLException { Context.getPermissionsManager().checkUser(getUserId(), id); - Context.getDataManager().removeUser(id); - Context.getPermissionsManager().refresh(); + Context.getPermissionsManager().removeUser(id); if (Context.getGeofenceManager() != null) { Context.getGeofenceManager().refreshUserGeofences(); } |