aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/BaseObjectResource.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/api/BaseObjectResource.java b/src/main/java/org/traccar/api/BaseObjectResource.java
index 489360619..d10843917 100644
--- a/src/main/java/org/traccar/api/BaseObjectResource.java
+++ b/src/main/java/org/traccar/api/BaseObjectResource.java
@@ -21,6 +21,7 @@ import org.traccar.model.BaseModel;
import org.traccar.model.Group;
import org.traccar.model.Permission;
import org.traccar.model.User;
+import org.traccar.session.ConnectionManager;
import org.traccar.session.cache.CacheManager;
import org.traccar.storage.StorageException;
import org.traccar.storage.query.Columns;
@@ -41,6 +42,9 @@ public abstract class BaseObjectResource<T extends BaseModel> extends BaseResour
@Inject
private CacheManager cacheManager;
+ @Inject
+ private ConnectionManager connectionManager;
+
protected final Class<T> baseClass;
public BaseObjectResource(Class<T> baseClass) {
@@ -68,6 +72,7 @@ public abstract class BaseObjectResource<T extends BaseModel> extends BaseResour
LogAction.create(getUserId(), entity);
storage.addPermission(new Permission(User.class, getUserId(), baseClass, entity.getId()));
cacheManager.invalidatePermission(User.class, getUserId(), baseClass, entity.getId());
+ connectionManager.invalidatePermission(User.class, getUserId(), baseClass, entity.getId());
LogAction.link(getUserId(), User.class, getUserId(), baseClass, entity.getId());
return Response.ok(entity).build();