diff options
Diffstat (limited to 'src/main/java/org/traccar/database/PermissionsManager.java')
-rw-r--r-- | src/main/java/org/traccar/database/PermissionsManager.java | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/main/java/org/traccar/database/PermissionsManager.java b/src/main/java/org/traccar/database/PermissionsManager.java index 9d1e5aadf..0ff20775a 100644 --- a/src/main/java/org/traccar/database/PermissionsManager.java +++ b/src/main/java/org/traccar/database/PermissionsManager.java @@ -40,7 +40,6 @@ public class PermissionsManager { private static final Logger LOGGER = LoggerFactory.getLogger(PermissionsManager.class); private final DataManager dataManager; - private final Storage storage; private final ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -49,9 +48,8 @@ public class PermissionsManager { private final Map<Long, Set<Long>> deviceUsers = new HashMap<>(); private final Map<Long, Set<Long>> groupDevices = new HashMap<>(); - public PermissionsManager(DataManager dataManager, Storage storage) { + public PermissionsManager(DataManager dataManager) { this.dataManager = dataManager; - this.storage = storage; refreshDeviceAndGroupPermissions(); } @@ -71,15 +69,6 @@ public class PermissionsManager { lock.writeLock().unlock(); } - public User getUser(long userId) { - try { - return storage.getObject(User.class, new Request( - new Columns.All(), new Condition.Equals("id", "id", userId))); - } catch (StorageException e) { - throw new RuntimeException(e); - } - } - public Set<Long> getGroupPermissions(long userId) { readLock(); try { @@ -174,11 +163,6 @@ public class PermissionsManager { } } - public boolean getUserAdmin(long userId) { - User user = getUser(userId); - return user != null && user.getAdministrator(); - } - public void refreshPermissions(Permission permission) { if (permission.getOwnerClass().equals(User.class)) { if (permission.getPropertyClass().equals(Device.class) |