aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/Context.java3
-rw-r--r--src/main/java/org/traccar/database/PermissionsManager.java18
2 files changed, 2 insertions, 19 deletions
diff --git a/src/main/java/org/traccar/Context.java b/src/main/java/org/traccar/Context.java
index 45d075912..dba0357c9 100644
--- a/src/main/java/org/traccar/Context.java
+++ b/src/main/java/org/traccar/Context.java
@@ -64,8 +64,7 @@ public final class Context {
Main.getInjector().getInstance(DataManager.class));
permissionsManager = new PermissionsManager(
- Main.getInjector().getInstance(DataManager.class),
- Main.getInjector().getInstance(Storage.class));
+ Main.getInjector().getInstance(DataManager.class));
}
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)