aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/SimpleObjectResource.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-04-09 11:10:05 -0700
committerAnton Tananaev <anton@traccar.org>2022-04-09 11:10:05 -0700
commit517c6a5ad687bb627caa665452043dae3be52bcf (patch)
tree2a492940b76c28a7bebc2780212c804ef1872c1b /src/main/java/org/traccar/api/SimpleObjectResource.java
parentb164114d23ad3d0f965c003489e31a6c0d78b0d3 (diff)
downloadtrackermap-server-517c6a5ad687bb627caa665452043dae3be52bcf.tar.gz
trackermap-server-517c6a5ad687bb627caa665452043dae3be52bcf.tar.bz2
trackermap-server-517c6a5ad687bb627caa665452043dae3be52bcf.zip
Fix simple objects get
Diffstat (limited to 'src/main/java/org/traccar/api/SimpleObjectResource.java')
-rw-r--r--src/main/java/org/traccar/api/SimpleObjectResource.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/SimpleObjectResource.java b/src/main/java/org/traccar/api/SimpleObjectResource.java
index b55bf91e3..c61101077 100644
--- a/src/main/java/org/traccar/api/SimpleObjectResource.java
+++ b/src/main/java/org/traccar/api/SimpleObjectResource.java
@@ -43,7 +43,11 @@ public class SimpleObjectResource<T extends BaseModel> extends BaseObjectResourc
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));
}