aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/PermissionsManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/database/PermissionsManager.java')
-rw-r--r--src/org/traccar/database/PermissionsManager.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java
index 9a82efd48..82ca6af49 100644
--- a/src/org/traccar/database/PermissionsManager.java
+++ b/src/org/traccar/database/PermissionsManager.java
@@ -322,6 +322,19 @@ public class PermissionsManager {
}
}
+ public void checkDriver(long userId, long driverId) throws SecurityException {
+ if (!Context.getDriversManager().checkDriver(userId, driverId) && !isAdmin(userId)) {
+ checkManager(userId);
+ for (long managedUserId : getUserPermissions(userId)) {
+ if (Context.getDriversManager().checkDriver(managedUserId, driverId)) {
+ return;
+ }
+ }
+ throw new SecurityException("Driver access denied");
+ }
+ }
+
+
public void checkCalendar(long userId, long calendarId) throws SecurityException {
if (!Context.getCalendarManager().checkCalendar(userId, calendarId) && !isAdmin(userId)) {
checkManager(userId);