diff options
author | Anton Tananaev <anton@traccar.org> | 2023-07-01 16:04:07 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-07-01 16:04:07 -0700 |
commit | 914cc6e85ba8696727edff2d8a600ae695bc410d (patch) | |
tree | 1c4841cb097b9b84bc0234e46ca8a20cd6bf8e24 /src/main/java/org/traccar/api | |
parent | cad2b8497c7cbd2cde4e50ec1ce2af1ceb37d02c (diff) | |
download | trackermap-server-914cc6e85ba8696727edff2d8a600ae695bc410d.tar.gz trackermap-server-914cc6e85ba8696727edff2d8a600ae695bc410d.tar.bz2 trackermap-server-914cc6e85ba8696727edff2d8a600ae695bc410d.zip |
Add calendar based filtering
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r-- | src/main/java/org/traccar/api/security/PermissionsService.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/api/security/PermissionsService.java b/src/main/java/org/traccar/api/security/PermissionsService.java index 18a376601..38bf48f30 100644 --- a/src/main/java/org/traccar/api/security/PermissionsService.java +++ b/src/main/java/org/traccar/api/security/PermissionsService.java @@ -24,7 +24,7 @@ import org.traccar.model.Group; import org.traccar.model.GroupedModel; import org.traccar.model.ManagedUser; import org.traccar.model.Notification; -import org.traccar.model.ScheduledModel; +import org.traccar.model.Schedulable; import org.traccar.model.Server; import org.traccar.model.User; import org.traccar.model.UserRestrictions; @@ -137,13 +137,13 @@ public class PermissionsService { } } } - if (object instanceof ScheduledModel) { - ScheduledModel after = ((ScheduledModel) object); + if (object instanceof Schedulable) { + Schedulable after = ((Schedulable) object); if (after.getCalendarId() > 0) { - ScheduledModel before = null; + Schedulable before = null; if (!addition) { before = storage.getObject(after.getClass(), new Request( - new Columns.Include("calendarId"), new Condition.Equals("id", after.getId()))); + new Columns.Include("calendarId"), new Condition.Equals("id", object.getId()))); } if (before == null || before.getCalendarId() != after.getCalendarId()) { checkPermission(Calendar.class, userId, after.getCalendarId()); @@ -156,7 +156,7 @@ public class PermissionsService { Notification before = null; if (!addition) { before = storage.getObject(after.getClass(), new Request( - new Columns.Include("commandId"), new Condition.Equals("id", after.getId()))); + new Columns.Include("commandId"), new Condition.Equals("id", object.getId()))); } if (before == null || before.getCommandId() != after.getCommandId()) { checkPermission(Command.class, userId, after.getCommandId()); |