aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-01-12 12:23:13 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-01-12 12:23:13 +1300
commit751569af4d09b693ec01442ae2241ee5ec6432d7 (patch)
tree96b40ba9562eaae387c4e9a5d9b9900c979f88c8
parent887eaceee6f1a15da75b1b3d5f8b97284fffe6e8 (diff)
downloadtraccar-server-751569af4d09b693ec01442ae2241ee5ec6432d7.tar.gz
traccar-server-751569af4d09b693ec01442ae2241ee5ec6432d7.tar.bz2
traccar-server-751569af4d09b693ec01442ae2241ee5ec6432d7.zip
Rename method to get permissions
-rw-r--r--src/org/traccar/database/PermissionsManager.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java
index 5557f37e5..c676dea23 100644
--- a/src/org/traccar/database/PermissionsManager.java
+++ b/src/org/traccar/database/PermissionsManager.java
@@ -36,7 +36,7 @@ public class PermissionsManager {
private final Map<Long, Set<Long>> permissions = new HashMap<>();
- private Set<Long> getNotNull(long userId) {
+ private Set<Long> getPermissions(long userId) {
if (!permissions.containsKey(userId)) {
permissions.put(userId, new HashSet<Long>());
}
@@ -57,7 +57,7 @@ public class PermissionsManager {
users.put(user.getId(), user);
}
for (Permission permission : dataManager.getPermissions()) {
- getNotNull(permission.getUserId()).add(permission.getDeviceId());
+ getPermissions(permission.getUserId()).add(permission.getDeviceId());
}
} catch (SQLException error) {
Log.warning(error);
@@ -81,11 +81,11 @@ public class PermissionsManager {
}
public Collection<Long> allowedDevices(long userId) {
- return getNotNull(userId);
+ return getPermissions(userId);
}
public void checkDevice(long userId, long deviceId) throws SecurityException {
- if (!getNotNull(userId).contains(deviceId)) {
+ if (!getPermissions(userId).contains(deviceId)) {
throw new SecurityException("Device access denied");
}
}