diff options
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r-- | src/main/java/org/traccar/api/security/PermissionsService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/security/PermissionsService.java b/src/main/java/org/traccar/api/security/PermissionsService.java index f39ded2b7..ea7a9d572 100644 --- a/src/main/java/org/traccar/api/security/PermissionsService.java +++ b/src/main/java/org/traccar/api/security/PermissionsService.java @@ -100,7 +100,9 @@ public class PermissionsService { } else if (clazz.equals(Device.class)) { denied = getServer().getDeviceReadonly() || getUser(userId).getDeviceReadonly(); if (addition) { - int deviceCount = storage.getPermissions(User.class, userId, Device.class).size(); + int deviceCount = storage.getObjects(Device.class, new Request( + new Columns.Include("id"), + new Condition.Permission(User.class, userId, Device.class))).size(); denied = deviceCount >= getUser(userId).getDeviceLimit(); } } else if (clazz.equals(Command.class)) { |