aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/UserResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/UserResource.java')
-rw-r--r--src/org/traccar/api/resource/UserResource.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java
index 4d8a8b3a4..98395e3cc 100644
--- a/src/org/traccar/api/resource/UserResource.java
+++ b/src/org/traccar/api/resource/UserResource.java
@@ -17,6 +17,7 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
+import org.traccar.model.ManagedUser;
import org.traccar.model.User;
import javax.annotation.security.PermitAll;
@@ -74,7 +75,7 @@ public class UserResource extends BaseResource {
}
Context.getPermissionsManager().addUser(entity);
if (Context.getPermissionsManager().isManager(getUserId())) {
- Context.getDataManager().linkUser(getUserId(), entity.getId());
+ Context.getDataManager().linkObject(User.class, getUserId(), ManagedUser.class, entity.getId(), true);
}
Context.getPermissionsManager().refreshUserPermissions();
if (Context.getNotificationManager() != null) {
@@ -104,7 +105,7 @@ public class UserResource extends BaseResource {
Context.getPermissionsManager().checkUser(getUserId(), id);
Context.getPermissionsManager().removeUser(id);
if (Context.getGeofenceManager() != null) {
- Context.getGeofenceManager().refreshUserGeofences();
+ Context.getGeofenceManager().refreshUserItems();
}
if (Context.getNotificationManager() != null) {
Context.getNotificationManager().refresh();