diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-09-19 22:10:44 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-19 22:10:44 +1200 |
commit | 6a40551d0e1d63fbb68f0401be73a4c64db4ca64 (patch) | |
tree | 36e5d835966f0a7d1d5563e24263b87734c86370 /src/org/traccar/database/PermissionsManager.java | |
parent | 561c616418918da4bb1d75c95347e25c23f72f6a (diff) | |
parent | 285f6feea43be782edc6233b709d47b146250361 (diff) | |
download | traccar-server-6a40551d0e1d63fbb68f0401be73a4c64db4ca64.tar.gz traccar-server-6a40551d0e1d63fbb68f0401be73a4c64db4ca64.tar.bz2 traccar-server-6a40551d0e1d63fbb68f0401be73a4c64db4ca64.zip |
Merge pull request #3534 from Abyss777/extend_notifications
Implement per device Notifications
Diffstat (limited to 'src/org/traccar/database/PermissionsManager.java')
-rw-r--r-- | src/org/traccar/database/PermissionsManager.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java index 0d9c780a6..07b60ba58 100644 --- a/src/org/traccar/database/PermissionsManager.java +++ b/src/org/traccar/database/PermissionsManager.java @@ -26,6 +26,7 @@ import org.traccar.model.Driver; import org.traccar.model.Geofence; import org.traccar.model.Group; import org.traccar.model.ManagedUser; +import org.traccar.model.Notification; import org.traccar.model.Permission; import org.traccar.model.Server; import org.traccar.model.User; @@ -320,6 +321,8 @@ public class PermissionsManager { manager = Context.getCalendarManager(); } else if (object.equals(Command.class)) { manager = Context.getCommandsManager(); + } else if (object.equals(Notification.class)) { + manager = Context.getNotificationManager(); } else { throw new IllegalArgumentException("Unknown object type"); } @@ -344,7 +347,7 @@ public class PermissionsManager { Context.getAttributesManager().refreshUserItems(); Context.getCommandsManager().refreshUserItems(); if (Context.getNotificationManager() != null) { - Context.getNotificationManager().refresh(); + Context.getNotificationManager().refreshUserItems(); } } @@ -375,6 +378,9 @@ public class PermissionsManager { Context.getCalendarManager().refreshUserItems(); } else if (permission.getPropertyClass().equals(Command.class)) { Context.getCommandsManager().refreshUserItems(); + } else if (permission.getPropertyClass().equals(Notification.class) + && Context.getNotificationManager() != null) { + Context.getNotificationManager().refreshUserItems(); } } else if (permission.getOwnerClass().equals(Device.class) || permission.getOwnerClass().equals(Group.class)) { if (permission.getPropertyClass().equals(Geofence.class) && Context.getGeofenceManager() != null) { @@ -385,6 +391,9 @@ public class PermissionsManager { Context.getAttributesManager().refreshExtendedPermissions(); } else if (permission.getPropertyClass().equals(Command.class)) { Context.getCommandsManager().refreshExtendedPermissions(); + } else if (permission.getPropertyClass().equals(Notification.class) + && Context.getNotificationManager() != null) { + Context.getNotificationManager().refreshExtendedPermissions(); } } } |