aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/GroupResource.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-20 23:03:09 +1200
committerGitHub <noreply@github.com>2016-07-20 23:03:09 +1200
commit73a7bbeb1f2c6caf7b1677e3616552ddb3eddeec (patch)
tree44b6ec5bcdf21990a3aff61a2cd556db0e8f463b /src/org/traccar/api/resource/GroupResource.java
parent8e4d44e045c6e0c800b3b353f6f55c64d731428c (diff)
parent56784bd167ddf0bbc124269519b7a93b346bd5cc (diff)
downloadtrackermap-server-73a7bbeb1f2c6caf7b1677e3616552ddb3eddeec.tar.gz
trackermap-server-73a7bbeb1f2c6caf7b1677e3616552ddb3eddeec.tar.bz2
trackermap-server-73a7bbeb1f2c6caf7b1677e3616552ddb3eddeec.zip
Merge pull request #2132 from Abyss777/move_groups_to_device_manager
Move groups related actions to DeviceManager
Diffstat (limited to 'src/org/traccar/api/resource/GroupResource.java')
-rw-r--r--src/org/traccar/api/resource/GroupResource.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/api/resource/GroupResource.java b/src/org/traccar/api/resource/GroupResource.java
index 957f39ebe..eec28e325 100644
--- a/src/org/traccar/api/resource/GroupResource.java
+++ b/src/org/traccar/api/resource/GroupResource.java
@@ -43,20 +43,20 @@ public class GroupResource extends BaseResource {
@QueryParam("all") boolean all, @QueryParam("userId") long userId) throws SQLException {
if (all) {
Context.getPermissionsManager().checkAdmin(getUserId());
- return Context.getDataManager().getAllGroups();
+ return Context.getDeviceManager().getAllGroups();
} else {
if (userId == 0) {
userId = getUserId();
}
Context.getPermissionsManager().checkUser(getUserId(), userId);
- return Context.getDataManager().getGroups(userId);
+ return Context.getDeviceManager().getGroups(userId);
}
}
@POST
public Response add(Group entity) throws SQLException {
Context.getPermissionsManager().checkReadonly(getUserId());
- Context.getDataManager().addGroup(entity);
+ Context.getDeviceManager().addGroup(entity);
Context.getDataManager().linkGroup(getUserId(), entity.getId());
Context.getPermissionsManager().refresh();
if (Context.getGeofenceManager() != null) {
@@ -70,7 +70,7 @@ public class GroupResource extends BaseResource {
public Response update(@PathParam("id") long id, Group entity) throws SQLException {
Context.getPermissionsManager().checkReadonly(getUserId());
Context.getPermissionsManager().checkGroup(getUserId(), id);
- Context.getDataManager().updateGroup(entity);
+ Context.getDeviceManager().updateGroup(entity);
if (Context.getGeofenceManager() != null) {
Context.getGeofenceManager().refresh();
}
@@ -82,7 +82,7 @@ public class GroupResource extends BaseResource {
public Response remove(@PathParam("id") long id) throws SQLException {
Context.getPermissionsManager().checkReadonly(getUserId());
Context.getPermissionsManager().checkGroup(getUserId(), id);
- Context.getDataManager().removeGroup(id);
+ Context.getDeviceManager().removeGroup(id);
Context.getPermissionsManager().refresh();
if (Context.getGeofenceManager() != null) {
Context.getGeofenceManager().refresh();