aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/reports/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/reports/common')
-rw-r--r--src/main/java/org/traccar/reports/common/ReportUtils.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/reports/common/ReportUtils.java b/src/main/java/org/traccar/reports/common/ReportUtils.java
index 95c43f8a0..84866a67b 100644
--- a/src/main/java/org/traccar/reports/common/ReportUtils.java
+++ b/src/main/java/org/traccar/reports/common/ReportUtils.java
@@ -38,8 +38,10 @@ import org.traccar.helper.UnitsConverter;
import org.traccar.helper.model.PositionUtil;
import org.traccar.helper.model.UserUtil;
import org.traccar.model.BaseModel;
+import org.traccar.model.Device;
import org.traccar.model.Driver;
import org.traccar.model.Event;
+import org.traccar.model.Group;
import org.traccar.model.Position;
import org.traccar.model.User;
import org.traccar.reports.model.BaseReportItem;
@@ -109,6 +111,16 @@ public class ReportUtils {
}
}
+ public void checkPermissions(
+ long userId, Collection<Long> deviceIds, Collection<Long> groupIds) throws StorageException {
+ for (long deviceId : deviceIds) {
+ permissionsService.checkPermission(Device.class, userId, deviceId);
+ }
+ for (long groupId : groupIds) {
+ permissionsService.checkPermission(Group.class, userId, groupId);
+ }
+ }
+
public Collection<Long> getDeviceList(Collection<Long> deviceIds, Collection<Long> groupIds) {
Collection<Long> result = new LinkedHashSet<>(deviceIds);
for (long groupId : groupIds) {