aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-22 13:34:16 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-22 13:34:16 -0700
commit402fd2b7faf1528f887de22d8175ccd80acf24a2 (patch)
tree65298c843f3bea3d7446a995f82a8c3e168268d6 /src/main
parentd2b164d54e4ae831b562ca7917d3117f2fe78c24 (diff)
downloadtrackermap-server-402fd2b7faf1528f887de22d8175ccd80acf24a2.tar.gz
trackermap-server-402fd2b7faf1528f887de22d8175ccd80acf24a2.tar.bz2
trackermap-server-402fd2b7faf1528f887de22d8175ccd80acf24a2.zip
Another permission optimization
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/api/ExtendedObjectResource.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/api/ExtendedObjectResource.java b/src/main/java/org/traccar/api/ExtendedObjectResource.java
index 1c306630c..6037118dd 100644
--- a/src/main/java/org/traccar/api/ExtendedObjectResource.java
+++ b/src/main/java/org/traccar/api/ExtendedObjectResource.java
@@ -47,11 +47,11 @@ public class ExtendedObjectResource<T extends BaseModel> extends BaseObjectResou
permissionsService.checkAdmin(getUserId());
} else {
if (userId == 0) {
- userId = getUserId();
+ conditions.add(new Condition.Permission(User.class, getUserId(), baseClass));
} else {
permissionsService.checkUser(getUserId(), userId);
+ conditions.add(new Condition.Permission(User.class, getUserId(), baseClass).excludeGroups());
}
- conditions.add(new Condition.Permission(User.class, userId, baseClass));
}
if (groupId > 0) {