diff options
author | Anton Tananaev <anton@traccar.org> | 2022-04-09 11:10:05 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-04-09 11:10:05 -0700 |
commit | 517c6a5ad687bb627caa665452043dae3be52bcf (patch) | |
tree | 2a492940b76c28a7bebc2780212c804ef1872c1b | |
parent | b164114d23ad3d0f965c003489e31a6c0d78b0d3 (diff) | |
download | trackermap-server-517c6a5ad687bb627caa665452043dae3be52bcf.tar.gz trackermap-server-517c6a5ad687bb627caa665452043dae3be52bcf.tar.bz2 trackermap-server-517c6a5ad687bb627caa665452043dae3be52bcf.zip |
Fix simple objects get
-rw-r--r-- | src/main/java/org/traccar/api/SimpleObjectResource.java | 6 |
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)); } |