aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/reports/EventsReportProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/reports/EventsReportProvider.java')
-rw-r--r--src/main/java/org/traccar/reports/EventsReportProvider.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/reports/EventsReportProvider.java b/src/main/java/org/traccar/reports/EventsReportProvider.java
index b1f7149a2..4db842fdb 100644
--- a/src/main/java/org/traccar/reports/EventsReportProvider.java
+++ b/src/main/java/org/traccar/reports/EventsReportProvider.java
@@ -74,9 +74,10 @@ public class EventsReportProvider {
long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
Collection<String> types, Date from, Date to) throws StorageException {
reportUtils.checkPeriodLimit(from, to);
+ reportUtils.checkPermissions(userId, deviceIds, groupIds);
+
ArrayList<Event> result = new ArrayList<>();
for (long deviceId: reportUtils.getDeviceList(deviceIds, groupIds)) {
- Context.getPermissionsManager().checkDevice(userId, deviceId);
Collection<Event> events = getEvents(deviceId, from, to);
boolean all = types.isEmpty() || types.contains(Event.ALL_EVENTS);
for (Event event : events) {
@@ -98,12 +99,13 @@ public class EventsReportProvider {
OutputStream outputStream, long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
Collection<String> types, Date from, Date to) throws StorageException, IOException {
reportUtils.checkPeriodLimit(from, to);
+ reportUtils.checkPermissions(userId, deviceIds, groupIds);
+
ArrayList<DeviceReportSection> devicesEvents = new ArrayList<>();
ArrayList<String> sheetNames = new ArrayList<>();
HashMap<Long, String> geofenceNames = new HashMap<>();
HashMap<Long, String> maintenanceNames = new HashMap<>();
for (long deviceId: reportUtils.getDeviceList(deviceIds, groupIds)) {
- Context.getPermissionsManager().checkDevice(userId, deviceId);
Collection<Event> events = getEvents(deviceId, from, to);
boolean all = types.isEmpty() || types.contains(Event.ALL_EVENTS);
for (Iterator<Event> iterator = events.iterator(); iterator.hasNext();) {