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