From 4d9d78496a0260c6cb43211065a8aafe8cc7e7a9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 21 Jan 2024 08:21:01 -0800 Subject: Improve sharing expiration limit --- src/main/java/org/traccar/api/resource/DeviceResource.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/api/resource/DeviceResource.java b/src/main/java/org/traccar/api/resource/DeviceResource.java index 8e634232a..89bba7237 100644 --- a/src/main/java/org/traccar/api/resource/DeviceResource.java +++ b/src/main/java/org/traccar/api/resource/DeviceResource.java @@ -210,6 +210,9 @@ public class DeviceResource extends BaseObjectResource { if (user.getTemporary()) { throw new SecurityException("Temporary user"); } + if (user.getExpirationTime() != null && user.getExpirationTime().before(expiration)) { + expiration = user.getExpirationTime(); + } Device device = storage.getObject(Device.class, new Request( new Columns.All(), -- cgit v1.2.3