From 517c6a5ad687bb627caa665452043dae3be52bcf Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Apr 2022 11:10:05 -0700 Subject: Fix simple objects get --- src/main/java/org/traccar/api/SimpleObjectResource.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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 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)); } -- cgit v1.2.3