aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/ExtendedObjectResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/api/ExtendedObjectResource.java')
-rw-r--r--src/main/java/org/traccar/api/ExtendedObjectResource.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/ExtendedObjectResource.java b/src/main/java/org/traccar/api/ExtendedObjectResource.java
index 6037118dd..e49f67bb9 100644
--- a/src/main/java/org/traccar/api/ExtendedObjectResource.java
+++ b/src/main/java/org/traccar/api/ExtendedObjectResource.java
@@ -44,7 +44,9 @@ public class ExtendedObjectResource<T extends BaseModel> extends BaseObjectResou
var conditions = new LinkedList<Condition>();
if (all) {
- permissionsService.checkAdmin(getUserId());
+ if (!permissionsService.isAdmin(getUserId())) {
+ conditions.add(new Condition.Permission(User.class, getUserId(), baseClass));
+ }
} else {
if (userId == 0) {
conditions.add(new Condition.Permission(User.class, getUserId(), baseClass));