aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/UserResource.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-25 17:33:00 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-26 13:18:36 +0500
commitbbcca3d65106069018e93a69b85290c075b128db (patch)
tree63e01dbf2ffc44e05fbf02a6a7cc0cb20c943d33 /src/org/traccar/api/resource/UserResource.java
parent234223a179d3f5e390cf8a649158676f8c349e5c (diff)
downloadtrackermap-server-bbcca3d65106069018e93a69b85290c075b128db.tar.gz
trackermap-server-bbcca3d65106069018e93a69b85290c075b128db.tar.bz2
trackermap-server-bbcca3d65106069018e93a69b85290c075b128db.zip
Split Drivers and Groups management
Diffstat (limited to 'src/org/traccar/api/resource/UserResource.java')
-rw-r--r--src/org/traccar/api/resource/UserResource.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java
index d3d82f99d..9998ed346 100644
--- a/src/org/traccar/api/resource/UserResource.java
+++ b/src/org/traccar/api/resource/UserResource.java
@@ -49,13 +49,12 @@ public class UserResource extends BaseResource {
Set<Long> result = null;
if (Context.getPermissionsManager().isAdmin(getUserId())) {
if (userId != 0) {
- result = usersManager.getManagedItems(userId);
+ result = usersManager.getUserItems(userId);
} else {
result = usersManager.getAllItems();
}
} else if (Context.getPermissionsManager().isManager(getUserId())) {
result = usersManager.getManagedItems(getUserId());
- result.add(getUserId());
} else {
throw new SecurityException("Admin or manager access required");
}
@@ -110,12 +109,8 @@ public class UserResource extends BaseResource {
Context.getPermissionsManager().checkReadonly(getUserId());
Context.getPermissionsManager().checkUser(getUserId(), id);
Context.getUsersManager().removeItem(id);
- if (Context.getGeofenceManager() != null) {
- Context.getGeofenceManager().refreshUserItems();
- }
- if (Context.getNotificationManager() != null) {
- Context.getNotificationManager().refresh();
- }
+ Context.getPermissionsManager().refreshDeviceAndGroupPermissions();
+ Context.getPermissionsManager().refreshAllUsersPermissions();
return Response.noContent().build();
}