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