aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-18 11:55:35 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-18 11:55:35 -0700
commit895e89504ff0ef6fe05e2a74847f9aa582a9d270 (patch)
tree046fb5b147f53aaaed4a5f6a569cb85a361c2c37 /src/main/java
parent03b50c61afd7c9d7e19a76feb261147dd0f69588 (diff)
downloadtrackermap-server-895e89504ff0ef6fe05e2a74847f9aa582a9d270.tar.gz
trackermap-server-895e89504ff0ef6fe05e2a74847f9aa582a9d270.tar.bz2
trackermap-server-895e89504ff0ef6fe05e2a74847f9aa582a9d270.zip
Remove unused code
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)