aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/UserResource.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-13 22:15:49 +1200
committerGitHub <noreply@github.com>2017-09-13 22:15:49 +1200
commit8a45a056b7e0814526904e915c3886b29ba2833a (patch)
treedc821e2134f4ae2c9881ce8de006a29b33da289f /src/org/traccar/api/resource/UserResource.java
parente05f0b83a911c522123a5a2cd14d6c16bd2de027 (diff)
parent7530522cbca477cb822cb494ffe12480e5237934 (diff)
downloadtrackermap-server-8a45a056b7e0814526904e915c3886b29ba2833a.tar.gz
trackermap-server-8a45a056b7e0814526904e915c3886b29ba2833a.tar.bz2
trackermap-server-8a45a056b7e0814526904e915c3886b29ba2833a.zip
Merge pull request #3522 from Abyss777/saved_commands
Implement Saved Commands
Diffstat (limited to 'src/org/traccar/api/resource/UserResource.java')
-rw-r--r--src/org/traccar/api/resource/UserResource.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java
index b22e01216..0eb328ab5 100644
--- a/src/org/traccar/api/resource/UserResource.java
+++ b/src/org/traccar/api/resource/UserResource.java
@@ -48,13 +48,13 @@ public class UserResource extends BaseObjectResource<User> {
public Collection<User> get(@QueryParam("userId") long userId) throws SQLException {
UsersManager usersManager = Context.getUsersManager();
Set<Long> result = null;
- if (Context.getPermissionsManager().isAdmin(getUserId())) {
+ if (Context.getPermissionsManager().getUserAdmin(getUserId())) {
if (userId != 0) {
result = usersManager.getUserItems(userId);
} else {
result = usersManager.getAllItems();
}
- } else if (Context.getPermissionsManager().isManager(getUserId())) {
+ } else if (Context.getPermissionsManager().getUserManager(getUserId())) {
result = usersManager.getManagedItems(getUserId());
} else {
throw new SecurityException("Admin or manager access required");
@@ -66,9 +66,9 @@ public class UserResource extends BaseObjectResource<User> {
@PermitAll
@POST
public Response add(User entity) throws SQLException {
- if (!Context.getPermissionsManager().isAdmin(getUserId())) {
+ if (!Context.getPermissionsManager().getUserAdmin(getUserId())) {
Context.getPermissionsManager().checkUserUpdate(getUserId(), new User(), entity);
- if (Context.getPermissionsManager().isManager(getUserId())) {
+ if (Context.getPermissionsManager().getUserManager(getUserId())) {
Context.getPermissionsManager().checkUserLimit(getUserId());
} else {
Context.getPermissionsManager().checkRegistration(getUserId());
@@ -81,7 +81,7 @@ public class UserResource extends BaseObjectResource<User> {
}
}
Context.getUsersManager().addItem(entity);
- if (Context.getPermissionsManager().isManager(getUserId())) {
+ if (Context.getPermissionsManager().getUserManager(getUserId())) {
Context.getDataManager().linkObject(User.class, getUserId(), ManagedUser.class, entity.getId(), true);
}
Context.getUsersManager().refreshUserItems();