aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/PermissionsManager.java
diff options
context:
space:
mode:
authorparveenkumaryadav <parveenkumardeeva@gmail.com>2018-01-10 16:17:25 +0530
committerparveenkumaryadav <parveenkumardeeva@gmail.com>2018-01-10 16:17:25 +0530
commit6428e67fe7732d15adcf27ffd261e3eda96840cd (patch)
treec58269dbcb12378f56875379d24b356b7e96ab12 /src/org/traccar/database/PermissionsManager.java
parent8dad0208975bf29e868a5ca9b6a844863f50d86c (diff)
downloadtrackermap-server-6428e67fe7732d15adcf27ffd261e3eda96840cd.tar.gz
trackermap-server-6428e67fe7732d15adcf27ffd261e3eda96840cd.tar.bz2
trackermap-server-6428e67fe7732d15adcf27ffd261e3eda96840cd.zip
Remove Odometer permission to User bug fix
Diffstat (limited to 'src/org/traccar/database/PermissionsManager.java')
-rw-r--r--src/org/traccar/database/PermissionsManager.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java
index 60bda99ce..05806175c 100644
--- a/src/org/traccar/database/PermissionsManager.java
+++ b/src/org/traccar/database/PermissionsManager.java
@@ -300,7 +300,13 @@ public class PermissionsManager {
}
public void checkDevice(long userId, long deviceId) throws SecurityException {
- if (!Context.getDeviceManager().getUserItems(userId).contains(deviceId) && !getUserAdmin(userId)) {
+ if (!Context.getDeviceManager().getUserItems(userId).contains(deviceId)) {
+ checkDeviceManagerOrAdmin(userId, deviceId);
+ }
+ }
+
+ public void checkDeviceManagerOrAdmin(long userId, long deviceId) throws SecurityException {
+ if (!getUserAdmin(userId)) {
checkManager(userId);
for (long managedUserId : usersManager.getUserItems(userId)) {
if (Context.getDeviceManager().getUserItems(managedUserId).contains(deviceId)) {