aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorSrk <watertext@hotmail.it>2017-11-18 19:22:10 +0100
committerSrk <watertext@hotmail.it>2017-11-18 19:22:10 +0100
commitf8fe96bf6f14d841b30284ae9a0973e9c5c98054 (patch)
treee4282289fa38ae649e138b44d9d56f4787440daf /src/org
parentabf9687234ed94dc130cab896355604f2c4115f3 (diff)
downloadtrackermap-server-f8fe96bf6f14d841b30284ae9a0973e9c5c98054.tar.gz
trackermap-server-f8fe96bf6f14d841b30284ae9a0973e9c5c98054.tar.bz2
trackermap-server-f8fe96bf6f14d841b30284ae9a0973e9c5c98054.zip
Revert "User defaults when no User is available"
This reverts commit 5117b2e64781161c9e06f57cbee217f174d5731e.
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/database/PermissionsManager.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java
index 203f25a3d..07b60ba58 100644
--- a/src/org/traccar/database/PermissionsManager.java
+++ b/src/org/traccar/database/PermissionsManager.java
@@ -56,8 +56,8 @@ public class PermissionsManager {
refreshDeviceAndGroupPermissions();
}
- public User getUser(Long userId) {
- return userId != null ? (User) usersManager.getById(userId) : null;
+ public User getUser(long userId) {
+ return (User) usersManager.getById(userId);
}
public Set<Long> getGroupPermissions(long userId) {
@@ -416,15 +416,10 @@ public class PermissionsManager {
return null;
}
- public Object lookupAttribute(Long userId, String key, Object defaultValue) {
+ public Object lookupAttribute(long userId, String key, Object defaultValue) {
Object preference;
- Object userPreference = null;
Object serverPreference = server.getAttributes().get(key);
-
- if (userId != null) {
- userPreference = getUser(userId).getAttributes().get(key);
- }
-
+ Object userPreference = getUser(userId).getAttributes().get(key);
if (server.getForceSettings()) {
preference = serverPreference != null ? serverPreference : userPreference;
} else {