diff options
-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)); } |