aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-01-21 08:21:01 -0800
committerAnton Tananaev <anton@traccar.org>2024-01-21 08:21:01 -0800
commit4d9d78496a0260c6cb43211065a8aafe8cc7e7a9 (patch)
tree9a49fb0322bb4086ee050c0b069a3c6595623cad
parentd4d66200bf1de4a1932765690ffb9eedd58f0900 (diff)
downloadtrackermap-server-4d9d78496a0260c6cb43211065a8aafe8cc7e7a9.tar.gz
trackermap-server-4d9d78496a0260c6cb43211065a8aafe8cc7e7a9.tar.bz2
trackermap-server-4d9d78496a0260c6cb43211065a8aafe8cc7e7a9.zip
Improve sharing expiration limit
-rw-r--r--src/main/java/org/traccar/api/resource/DeviceResource.java3
1 files changed, 3 insertions, 0 deletions
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<Device> {
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(),