diff options
Diffstat (limited to 'src/org/traccar/api/resource/GroupResource.java')
-rw-r--r-- | src/org/traccar/api/resource/GroupResource.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/api/resource/GroupResource.java b/src/org/traccar/api/resource/GroupResource.java index 97b6d671d..0d9572332 100644 --- a/src/org/traccar/api/resource/GroupResource.java +++ b/src/org/traccar/api/resource/GroupResource.java @@ -97,6 +97,9 @@ public class GroupResource extends BaseResource { @POST public Response add(Map<String, Long> entity) throws SQLException { Context.getPermissionsManager().checkReadonly(getUserId()); + if (entity.size() != 2) { + throw new IllegalArgumentException(); + } for (String key : entity.keySet()) { Context.getPermissionsManager().checkPermission(key.replace("Id", ""), getUserId(), entity.get(key)); } @@ -109,6 +112,9 @@ public class GroupResource extends BaseResource { @DELETE public Response remove(Map<String, Long> entity) throws SQLException { Context.getPermissionsManager().checkReadonly(getUserId()); + if (entity.size() != 2) { + throw new IllegalArgumentException(); + } for (String key : entity.keySet()) { Context.getPermissionsManager().checkPermission(key.replace("Id", ""), getUserId(), entity.get(key)); } |