diff options
author | Anton Tananaev <anton@traccar.org> | 2022-11-01 17:06:51 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-11-01 17:06:51 -0700 |
commit | d5ac6aa371b5dfd9a6613e693a6afc711fb740df (patch) | |
tree | 764ce7ab16373e8e3d28b27cf09b520267648f39 /src/main/java/org/traccar/api/security | |
parent | 87d54329d8d6ba14f37e15967079bcfc7299228c (diff) | |
download | trackermap-server-d5ac6aa371b5dfd9a6613e693a6afc711fb740df.tar.gz trackermap-server-d5ac6aa371b5dfd9a6613e693a6afc711fb740df.tar.bz2 trackermap-server-d5ac6aa371b5dfd9a6613e693a6afc711fb740df.zip |
Improve permission check
Diffstat (limited to 'src/main/java/org/traccar/api/security')
-rw-r--r-- | src/main/java/org/traccar/api/security/PermissionsService.java | 2 |
1 files changed, 1 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 0d4877fdb..71acb3d48 100644 --- a/src/main/java/org/traccar/api/security/PermissionsService.java +++ b/src/main/java/org/traccar/api/security/PermissionsService.java @@ -104,7 +104,7 @@ public class PermissionsService { } else if (clazz.equals(Device.class)) { denied = getServer().getDeviceReadonly() || getUser(userId).getDeviceReadonly() || addition && getUser(userId).getDeviceLimit() == 0; - if (addition && getUser(userId).getDeviceLimit() > 0) { + if (!denied && addition && getUser(userId).getDeviceLimit() > 0) { int deviceCount = storage.getObjects(Device.class, new Request( new Columns.Include("id"), new Condition.Permission(User.class, userId, Device.class))).size(); |