aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/PermissionsManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-19 10:42:07 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-19 14:46:54 +0500
commit9519b653a8cef055366b0903fdd371c8f86d1206 (patch)
tree330fe6bb9ee1fe45330979f16f16e204e1437447 /src/org/traccar/database/PermissionsManager.java
parentc82fd979ad17ecfb7dd8f3e366c067b66f4cdabc (diff)
downloadtrackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.tar.gz
trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.tar.bz2
trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.zip
Implement per device Notifications
Diffstat (limited to 'src/org/traccar/database/PermissionsManager.java')
-rw-r--r--src/org/traccar/database/PermissionsManager.java11
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();
}
}
}