aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/UserResource.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-01-01 20:40:45 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-01-01 20:40:45 +1300
commit8686fbe48d485be94b63e723258f19ef93abcaad (patch)
tree225911da1fa8d315fa444b4437be55f7b542a625 /src/org/traccar/api/resource/UserResource.java
parent07dddfa531179f9ccdf73410e44807d84c480fd3 (diff)
downloadtrackermap-server-8686fbe48d485be94b63e723258f19ef93abcaad.tar.gz
trackermap-server-8686fbe48d485be94b63e723258f19ef93abcaad.tar.bz2
trackermap-server-8686fbe48d485be94b63e723258f19ef93abcaad.zip
Always allow admin to register new users
Diffstat (limited to 'src/org/traccar/api/resource/UserResource.java')
-rw-r--r--src/org/traccar/api/resource/UserResource.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java
index 4d57d5b0c..9eb0d9597 100644
--- a/src/org/traccar/api/resource/UserResource.java
+++ b/src/org/traccar/api/resource/UserResource.java
@@ -47,7 +47,9 @@ public class UserResource extends BaseResource {
@PermitAll
@POST
public Response add(User entity) throws SQLException {
- Context.getPermissionsManager().checkRegistration(getUserId());
+ if (!Context.getPermissionsManager().isAdmin(getUserId())) {
+ Context.getPermissionsManager().checkRegistration(getUserId());
+ }
Context.getDataManager().addUser(entity);
Context.getPermissionsManager().refresh();
return Response.ok(entity).build();