From 2bd45c3cad1d619177649c7e66e4141b99e12228 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 16 Feb 2017 02:47:01 +1300 Subject: Refresh permissions for new devices --- src/org/traccar/BaseProtocolDecoder.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index 8748a9be6..e5fa76a47 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -46,7 +46,16 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { try { Context.getDeviceManager().addDevice(device); + Log.info("Automatically registered device " + uniqueId); + + if (defaultGroupId != 0) { + Context.getPermissionsManager().refreshPermissions(); + if (Context.getGeofenceManager() != null) { + Context.getGeofenceManager().refresh(); + } + } + return device.getId(); } catch (SQLException e) { Log.warning(e); -- cgit v1.2.3