From c67bf883bf0aa84293b94b000536c2061c3e00b2 Mon Sep 17 00:00:00 2001 From: Christoph Krey Date: Sun, 2 Jul 2017 10:20:50 +0200 Subject: [FIX] permission check before getting device, eleminate unnecessary variable. --- src/org/traccar/api/resource/DeviceResource.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java index 0f75b5e33..ce46b4e29 100644 --- a/src/org/traccar/api/resource/DeviceResource.java +++ b/src/org/traccar/api/resource/DeviceResource.java @@ -64,9 +64,8 @@ public class DeviceResource extends BaseResource { } else { ArrayList devices = new ArrayList<>(); for (Long deviceId : deviceIds) { - Device device = Context.getDeviceManager().getDeviceById(deviceId); - Context.getPermissionsManager().checkDevice(getUserId(), device.getId()); - devices.add(device); + Context.getPermissionsManager().checkDevice(getUserId(), deviceId); + devices.add(Context.getDeviceManager().getDeviceById(deviceId)); } return devices; } -- cgit v1.2.3