diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-24 14:55:06 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-24 14:55:06 +1200 |
commit | ea0bdea88003f46fd6f6164d5c45e33d53f47c81 (patch) | |
tree | d8e51a10e56f7e916cc2bf7486d75c90feb5696e /src/org/traccar/api/resource/UserResource.java | |
parent | a645eb8e2338f11e2c807045b1787a47cd1f1464 (diff) | |
parent | f6484e9808f50aa997f028f9421b05aad6aed8bd (diff) | |
download | trackermap-server-ea0bdea88003f46fd6f6164d5c45e33d53f47c81.tar.gz trackermap-server-ea0bdea88003f46fd6f6164d5c45e33d53f47c81.tar.bz2 trackermap-server-ea0bdea88003f46fd6f6164d5c45e33d53f47c81.zip |
Merge pull request #2242 from Abyss777/users_cache
Implement users cache
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(); } |