aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-11-04 08:55:31 -0700
committerAnton Tananaev <anton@traccar.org>2022-11-04 08:55:31 -0700
commit21a916159a24db0cbec850b90381f9ff392f3c0e (patch)
tree1419d994a56764f093a00772e654efa43208804a /src
parente742f252da0b32ac7166c6d9ab25a8d1375411d2 (diff)
downloadtrackermap-server-21a916159a24db0cbec850b90381f9ff392f3c0e.tar.gz
trackermap-server-21a916159a24db0cbec850b90381f9ff392f3c0e.tar.bz2
trackermap-server-21a916159a24db0cbec850b90381f9ff392f3c0e.zip
Clean up command resource
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/api/resource/CommandResource.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/api/resource/CommandResource.java b/src/main/java/org/traccar/api/resource/CommandResource.java
index 80b9fd18f..6ef6ee9c5 100644
--- a/src/main/java/org/traccar/api/resource/CommandResource.java
+++ b/src/main/java/org/traccar/api/resource/CommandResource.java
@@ -84,10 +84,10 @@ public class CommandResource extends ExtendedObjectResource<Command> {
permissionsService.checkPermission(Device.class, getUserId(), deviceId);
BaseProtocol protocol = getDeviceProtocol(deviceId);
- var commands = storage.getObjects(Command.class, new Request(
+ var commands = storage.getObjects(baseClass, new Request(
new Columns.All(),
Condition.merge(List.of(
- new Condition.Permission(User.class, getUserId(), Command.class),
+ new Condition.Permission(User.class, getUserId(), baseClass),
new Condition.Permission(Device.class, deviceId, baseClass)
))));
@@ -107,7 +107,7 @@ public class CommandResource extends ExtendedObjectResource<Command> {
public Response send(Command entity) throws Exception {
permissionsService.checkRestriction(getUserId(), UserRestrictions::getReadonly);
if (entity.getId() > 0) {
- permissionsService.checkPermission(Command.class, getUserId(), entity.getId());
+ permissionsService.checkPermission(baseClass, getUserId(), entity.getId());
long deviceId = entity.getDeviceId();
entity = storage.getObject(baseClass, new Request(
new Columns.All(), new Condition.Equals("id", entity.getId())));