aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-02-07 18:24:55 +0800
committerGitHub <noreply@github.com>2017-02-07 18:24:55 +0800
commit141359fd15185f7542d3b0bfea9467902461bd7b (patch)
tree141ba8e05018e59e227e7460b5e033c9a7221201
parent61738a2b4911c502bce2d06e002b8d825d3fccb2 (diff)
parent648096e5bad55a22f4e45a455eb219692039e900 (diff)
downloadtrackermap-server-141359fd15185f7542d3b0bfea9467902461bd7b.tar.gz
trackermap-server-141359fd15185f7542d3b0bfea9467902461bd7b.tar.bz2
trackermap-server-141359fd15185f7542d3b0bfea9467902461bd7b.zip
Merge pull request #2878 from Abyss777/commands_readonly
Do not allow readonly users send commands
-rw-r--r--src/org/traccar/api/resource/CommandResource.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/org/traccar/api/resource/CommandResource.java b/src/org/traccar/api/resource/CommandResource.java
index cce2dac2b..e13ae9de8 100644
--- a/src/org/traccar/api/resource/CommandResource.java
+++ b/src/org/traccar/api/resource/CommandResource.java
@@ -33,6 +33,8 @@ public class CommandResource extends BaseResource {
@POST
public Response add(Command entity) {
+ Context.getPermissionsManager().checkReadonly(getUserId());
+ Context.getPermissionsManager().checkDeviceReadonly(getUserId());
Context.getPermissionsManager().checkDevice(getUserId(), entity.getDeviceId());
Context.getConnectionManager().getActiveDevice(entity.getDeviceId()).sendCommand(entity);
return Response.ok(entity).build();