diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-07 18:24:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-07 18:24:55 +0800 |
commit | 141359fd15185f7542d3b0bfea9467902461bd7b (patch) | |
tree | 141ba8e05018e59e227e7460b5e033c9a7221201 /src | |
parent | 61738a2b4911c502bce2d06e002b8d825d3fccb2 (diff) | |
parent | 648096e5bad55a22f4e45a455eb219692039e900 (diff) | |
download | trackermap-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
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/api/resource/CommandResource.java | 2 |
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(); |