From 7855762df494ed113210d5d202a13de279b13dcc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 16 Jan 2024 20:45:27 -0800 Subject: Disallow device re-sharing --- src/main/java/org/traccar/api/resource/DeviceResource.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/main/java/org/traccar/api/resource/DeviceResource.java b/src/main/java/org/traccar/api/resource/DeviceResource.java index 540450cbb..d7c5a5477 100644 --- a/src/main/java/org/traccar/api/resource/DeviceResource.java +++ b/src/main/java/org/traccar/api/resource/DeviceResource.java @@ -204,6 +204,9 @@ public class DeviceResource extends BaseObjectResource { @FormParam("expiration") Date expiration) throws StorageException, GeneralSecurityException, IOException { User user = permissionsService.getUser(getUserId()); + if (user.getTemporary()) { + throw new SecurityException("Temporary user"); + } Device device = storage.getObject(Device.class, new Request( new Columns.All(), -- cgit v1.2.3