aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/api/security/PermissionsService.java2
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();