diff options
author | Anton Tananaev <anton@traccar.org> | 2022-04-09 13:18:43 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-04-09 13:18:43 -0700 |
commit | c2c58a30ae0857c4e584b128899baa63a684a892 (patch) | |
tree | dfb1e9f0822fac36a7a6c6cdb99862cb6e742d66 | |
parent | 517c6a5ad687bb627caa665452043dae3be52bcf (diff) | |
download | trackermap-server-c2c58a30ae0857c4e584b128899baa63a684a892.tar.gz trackermap-server-c2c58a30ae0857c4e584b128899baa63a684a892.tar.bz2 trackermap-server-c2c58a30ae0857c4e584b128899baa63a684a892.zip |
Fix extended object resource
-rw-r--r-- | src/main/java/org/traccar/api/ExtendedObjectResource.java | 6 |
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)); } |