diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-13 17:36:31 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-13 17:36:31 +1200 |
commit | fc75fe4ab4f8ea9de58c41772fdd92c10c73f2bc (patch) | |
tree | 9418ef08d1b5d8858922b90e4c0b9e2f1747b2ee /src/org/traccar/http/ServerServlet.java | |
parent | bd4c32abced2bb654b64a2042668340167d6b191 (diff) | |
download | trackermap-server-fc75fe4ab4f8ea9de58c41772fdd92c10c73f2bc.tar.gz trackermap-server-fc75fe4ab4f8ea9de58c41772fdd92c10c73f2bc.tar.bz2 trackermap-server-fc75fe4ab4f8ea9de58c41772fdd92c10c73f2bc.zip |
Fix API access permissions
Diffstat (limited to 'src/org/traccar/http/ServerServlet.java')
-rw-r--r-- | src/org/traccar/http/ServerServlet.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/http/ServerServlet.java b/src/org/traccar/http/ServerServlet.java index baac99084..d814769a8 100644 --- a/src/org/traccar/http/ServerServlet.java +++ b/src/org/traccar/http/ServerServlet.java @@ -40,8 +40,9 @@ public class ServerServlet extends BaseServlet { } private void update(HttpServletRequest req, HttpServletResponse resp) throws Exception { - Context.getDataManager().updateServer(JsonConverter.objectFromJson( - req.getReader(), new Server())); + Server server = JsonConverter.objectFromJson(req.getReader(), new Server()); + Context.getPermissionsManager().checkAdmin(getUserId(req)); + Context.getDataManager().updateServer(server); sendResponse(resp.getWriter(), true); } |