aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-01-16 20:45:27 -0800
committerAnton Tananaev <anton@traccar.org>2024-01-16 20:45:36 -0800
commit7855762df494ed113210d5d202a13de279b13dcc (patch)
treec459ec7c36f166a8cd8fae930ba6fa305ffa3083 /src/main
parent7d7a58d4696188bd904cd462034e5ee2655140f3 (diff)
downloadtrackermap-server-7855762df494ed113210d5d202a13de279b13dcc.tar.gz
trackermap-server-7855762df494ed113210d5d202a13de279b13dcc.tar.bz2
trackermap-server-7855762df494ed113210d5d202a13de279b13dcc.zip
Disallow device re-sharing
Diffstat (limited to 'src/main')
-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 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<Device> {
@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(),