diff options
author | Abyss777 <abyss@fox5.ru> | 2016-11-18 18:08:52 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-11-18 18:08:52 +0500 |
commit | 670c8c7041163a2232d3edb4ef413af70182ea0a (patch) | |
tree | b18b1aa0b18709d1b75aa3f78c69264daca7f060 /src/org/traccar/api/resource/UserResource.java | |
parent | c9b67d19132b687bea9130f39f13a5515b120e5e (diff) | |
download | trackermap-server-670c8c7041163a2232d3edb4ef413af70182ea0a.tar.gz trackermap-server-670c8c7041163a2232d3edb4ef413af70182ea0a.tar.bz2 trackermap-server-670c8c7041163a2232d3edb4ef413af70182ea0a.zip |
- Flip user-token map
- Fix null check
- Combine validation to setter
Diffstat (limited to 'src/org/traccar/api/resource/UserResource.java')
-rw-r--r-- | src/org/traccar/api/resource/UserResource.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java index 094de2812..2ff1639f6 100644 --- a/src/org/traccar/api/resource/UserResource.java +++ b/src/org/traccar/api/resource/UserResource.java @@ -67,7 +67,8 @@ public class UserResource extends BaseResource { || old.getReadonly() != entity.getReadonly() || old.getDisabled() != entity.getDisabled() || old.getDeviceLimit() != entity.getDeviceLimit() - || !old.getToken().equals(entity.getToken())) { + || old.getToken() == null && entity.getToken() != null + || old.getToken() != null && !old.getToken().equals(entity.getToken())) { Context.getPermissionsManager().checkAdmin(getUserId()); } else { Context.getPermissionsManager().checkUser(getUserId(), entity.getId()); |