aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/api/ExtendedObjectResource.java6
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));
}