From 6428e67fe7732d15adcf27ffd261e3eda96840cd Mon Sep 17 00:00:00 2001 From: parveenkumaryadav Date: Wed, 10 Jan 2018 16:17:25 +0530 Subject: Remove Odometer permission to User bug fix --- src/org/traccar/database/PermissionsManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/database') diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java index 60bda99ce..05806175c 100644 --- a/src/org/traccar/database/PermissionsManager.java +++ b/src/org/traccar/database/PermissionsManager.java @@ -300,7 +300,13 @@ public class PermissionsManager { } public void checkDevice(long userId, long deviceId) throws SecurityException { - if (!Context.getDeviceManager().getUserItems(userId).contains(deviceId) && !getUserAdmin(userId)) { + if (!Context.getDeviceManager().getUserItems(userId).contains(deviceId)) { + checkDeviceManagerOrAdmin(userId, deviceId); + } + } + + public void checkDeviceManagerOrAdmin(long userId, long deviceId) throws SecurityException { + if (!getUserAdmin(userId)) { checkManager(userId); for (long managedUserId : usersManager.getUserItems(userId)) { if (Context.getDeviceManager().getUserItems(managedUserId).contains(deviceId)) { -- cgit v1.2.3