aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/resource
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-01-18 07:06:46 -0800
committerAnton Tananaev <anton@traccar.org>2024-01-18 07:06:46 -0800
commit22f45bd129f275b930ab2166a6b76713ca972abf (patch)
tree578772e7012a17cd3fb07083977a733687fdb913 /src/main/java/org/traccar/api/resource
parent2eba0bdf8c02036d6761667f0aa022ead9587c11 (diff)
downloadtrackermap-server-22f45bd129f275b930ab2166a6b76713ca972abf.tar.gz
trackermap-server-22f45bd129f275b930ab2166a6b76713ca972abf.tar.bz2
trackermap-server-22f45bd129f275b930ab2166a6b76713ca972abf.zip
Option to disable device sharing
Diffstat (limited to 'src/main/java/org/traccar/api/resource')
-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 00a3fc5b9..c3ced9b84 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 (permissionsService.getServer().getBoolean(Keys.DEVICE_SHARE_DISABLE.getKey())) {
+ throw new SecurityException("Sharing is disabled");
+ }
if (user.getTemporary()) {
throw new SecurityException("Temporary user");
}