From 402fd2b7faf1528f887de22d8175ccd80acf24a2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 22 May 2022 13:34:16 -0700 Subject: Another permission optimization --- src/main/java/org/traccar/api/ExtendedObjectResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') 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 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) { -- cgit v1.2.3