aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/resource
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-13 17:31:52 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-13 17:31:52 -0700
commita8e38b74e5fc6789676bf35a9b92594a230e3ad8 (patch)
treeeed89969aecd7c9652f8640742530c96a4fc40b3 /src/main/java/org/traccar/api/resource
parent33733f835e88a62c4a5259ab330723b88037adf1 (diff)
downloadtrackermap-server-a8e38b74e5fc6789676bf35a9b92594a230e3ad8.tar.gz
trackermap-server-a8e38b74e5fc6789676bf35a9b92594a230e3ad8.tar.bz2
trackermap-server-a8e38b74e5fc6789676bf35a9b92594a230e3ad8.zip
Avoid broadcast loops (fix #4894)
Diffstat (limited to 'src/main/java/org/traccar/api/resource')
-rw-r--r--src/main/java/org/traccar/api/resource/PermissionsResource.java2
-rw-r--r--src/main/java/org/traccar/api/resource/ServerResource.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/resource/PermissionsResource.java b/src/main/java/org/traccar/api/resource/PermissionsResource.java
index 44fc897ac..d35cb98bb 100644
--- a/src/main/java/org/traccar/api/resource/PermissionsResource.java
+++ b/src/main/java/org/traccar/api/resource/PermissionsResource.java
@@ -72,6 +72,7 @@ public class PermissionsResource extends BaseResource {
checkPermission(permission);
storage.addPermission(permission);
cacheManager.invalidatePermission(
+ true,
permission.getOwnerClass(), permission.getOwnerId(),
permission.getPropertyClass(), permission.getPropertyId());
LogAction.link(getUserId(),
@@ -96,6 +97,7 @@ public class PermissionsResource extends BaseResource {
checkPermission(permission);
storage.removePermission(permission);
cacheManager.invalidatePermission(
+ true,
permission.getOwnerClass(), permission.getOwnerId(),
permission.getPropertyClass(), permission.getPropertyId());
LogAction.unlink(getUserId(),
diff --git a/src/main/java/org/traccar/api/resource/ServerResource.java b/src/main/java/org/traccar/api/resource/ServerResource.java
index 3e6792f5b..4fc76a0d7 100644
--- a/src/main/java/org/traccar/api/resource/ServerResource.java
+++ b/src/main/java/org/traccar/api/resource/ServerResource.java
@@ -77,7 +77,7 @@ public class ServerResource extends BaseResource {
storage.updateObject(entity, new Request(
new Columns.Exclude("id"),
new Condition.Equals("id", "id")));
- cacheManager.updateOrInvalidate(entity);
+ cacheManager.updateOrInvalidate(true, entity);
LogAction.edit(getUserId(), entity);
return Response.ok(entity).build();
}