aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-04-09 13:18:43 -0700
committerAnton Tananaev <anton@traccar.org>2022-04-09 13:18:43 -0700
commitc2c58a30ae0857c4e584b128899baa63a684a892 (patch)
treedfb1e9f0822fac36a7a6c6cdb99862cb6e742d66 /src/main/java/org/traccar
parent517c6a5ad687bb627caa665452043dae3be52bcf (diff)
downloadtrackermap-server-c2c58a30ae0857c4e584b128899baa63a684a892.tar.gz
trackermap-server-c2c58a30ae0857c4e584b128899baa63a684a892.tar.bz2
trackermap-server-c2c58a30ae0857c4e584b128899baa63a684a892.zip
Fix extended object resource
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/api/ExtendedObjectResource.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/ExtendedObjectResource.java b/src/main/java/org/traccar/api/ExtendedObjectResource.java
index a12314a2c..40d679ded 100644
--- a/src/main/java/org/traccar/api/ExtendedObjectResource.java
+++ b/src/main/java/org/traccar/api/ExtendedObjectResource.java
@@ -46,7 +46,11 @@ public class ExtendedObjectResource<T extends BaseModel> extends BaseObjectResou
if (all) {
permissionsService.checkAdmin(getUserId());
} else {
- permissionsService.checkUser(getUserId(), userId);
+ if (userId == 0) {
+ userId = getUserId();
+ } else {
+ permissionsService.checkUser(getUserId(), userId);
+ }
conditions.add(new Condition.Permission(User.class, userId, baseClass));
}