From d4d66200bf1de4a1932765690ffb9eedd58f0900 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 21 Jan 2024 08:17:47 -0800 Subject: Improve sharing permissions --- src/main/java/org/traccar/api/resource/DeviceResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/api/resource/DeviceResource.java b/src/main/java/org/traccar/api/resource/DeviceResource.java index c3ced9b84..8e634232a 100644 --- a/src/main/java/org/traccar/api/resource/DeviceResource.java +++ b/src/main/java/org/traccar/api/resource/DeviceResource.java @@ -228,8 +228,8 @@ public class DeviceResource extends BaseObjectResource { share.setExpirationTime(expiration); share.setTemporary(true); share.setReadonly(true); - share.setLimitCommands(!config.getBoolean(Keys.WEB_SHARE_DEVICE_COMMANDS)); - share.setDisableReports(!config.getBoolean(Keys.WEB_SHARE_DEVICE_REPORTS)); + share.setLimitCommands(user.getLimitCommands() || !config.getBoolean(Keys.WEB_SHARE_DEVICE_COMMANDS)); + share.setDisableReports(user.getDisableReports() || !config.getBoolean(Keys.WEB_SHARE_DEVICE_REPORTS)); share.setId(storage.addObject(share, new Request(new Columns.Exclude("id")))); -- cgit v1.2.3