diff options
author | Christoph Krey <krey.christoph@gmail.com> | 2017-07-02 10:20:50 +0200 |
---|---|---|
committer | Christoph Krey <krey.christoph@gmail.com> | 2017-07-02 10:20:50 +0200 |
commit | c67bf883bf0aa84293b94b000536c2061c3e00b2 (patch) | |
tree | f2f478a2f9ac4b703f74c294d5a96a9842c405c1 /src/org/traccar/api | |
parent | 4fce9334c72acf8e7ef78c7b2c7b60380e77e6cb (diff) | |
download | traccar-server-c67bf883bf0aa84293b94b000536c2061c3e00b2.tar.gz traccar-server-c67bf883bf0aa84293b94b000536c2061c3e00b2.tar.bz2 traccar-server-c67bf883bf0aa84293b94b000536c2061c3e00b2.zip |
[FIX] permission check before getting device, eleminate unnecessary variable.
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r-- | src/org/traccar/api/resource/DeviceResource.java | 5 |
1 files 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<Device> 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; } |