aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/UserResource.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-13 09:05:21 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-13 09:05:21 +0500
commit7b3a3ca4592688f0946076628aa86241a41b1aa8 (patch)
treeaf41bb7391d62d57323ecd3c3d6b476cbf14d974 /src/org/traccar/api/resource/UserResource.java
parent925806fe70e10e47bcc12eb8bcc4fe21a9ece220 (diff)
downloadtrackermap-server-7b3a3ca4592688f0946076628aa86241a41b1aa8.tar.gz
trackermap-server-7b3a3ca4592688f0946076628aa86241a41b1aa8.tar.bz2
trackermap-server-7b3a3ca4592688f0946076628aa86241a41b1aa8.zip
- Rename functions "isXxx" to "getUserXxx"
- Rename function to "getSupportedCommands" - Some cleanup
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();