aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/BaseObjectResource.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-28 08:13:03 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-28 08:13:03 -0700
commita487c1efa5dff2a7644ee7f2874967f4bb867b6a (patch)
tree0d266dd5809dbc5a78d293675005e11b27bf0c2b /src/main/java/org/traccar/api/BaseObjectResource.java
parentef644e5185b3109b0da30972a0b5c56768c69957 (diff)
downloadtrackermap-server-a487c1efa5dff2a7644ee7f2874967f4bb867b6a.tar.gz
trackermap-server-a487c1efa5dff2a7644ee7f2874967f4bb867b6a.tar.bz2
trackermap-server-a487c1efa5dff2a7644ee7f2874967f4bb867b6a.zip
Fix new device updates
Diffstat (limited to 'src/main/java/org/traccar/api/BaseObjectResource.java')
-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();