aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/PermissionsResource.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-12-14 13:36:19 +0500
committerAbyss777 <abyss@fox5.ru>2017-12-18 16:59:55 +0500
commit6028f7b37c4fc8bf1e771b33aee09e5f4276c5cf (patch)
treea347ad1207b2621843b64b5796a0e1670205b6f3 /src/org/traccar/api/resource/PermissionsResource.java
parent30c269bb3e7994eb94e3f53704b3c6ef6d3d124a (diff)
downloadtrackermap-server-6028f7b37c4fc8bf1e771b33aee09e5f4276c5cf.tar.gz
trackermap-server-6028f7b37c4fc8bf1e771b33aee09e5f4276c5cf.tar.bz2
trackermap-server-6028f7b37c4fc8bf1e771b33aee09e5f4276c5cf.zip
Log user actions
Diffstat (limited to 'src/org/traccar/api/resource/PermissionsResource.java')
-rw-r--r--src/org/traccar/api/resource/PermissionsResource.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/api/resource/PermissionsResource.java b/src/org/traccar/api/resource/PermissionsResource.java
index 9b9f65ad1..b89d9d376 100644
--- a/src/org/traccar/api/resource/PermissionsResource.java
+++ b/src/org/traccar/api/resource/PermissionsResource.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.Response;
import org.traccar.Context;
import org.traccar.api.BaseResource;
+import org.traccar.helper.LogAction;
import org.traccar.model.Device;
import org.traccar.model.Permission;
import org.traccar.model.User;
@@ -61,6 +62,8 @@ public class PermissionsResource extends BaseResource {
checkPermission(permission, true);
Context.getDataManager().linkObject(permission.getOwnerClass(), permission.getOwnerId(),
permission.getPropertyClass(), permission.getPropertyId(), true);
+ LogAction.link(getUserId(), permission.getOwnerClass(), permission.getOwnerId(),
+ permission.getPropertyClass(), permission.getPropertyId());
Context.getPermissionsManager().refreshPermissions(permission);
return Response.noContent().build();
}
@@ -72,6 +75,8 @@ public class PermissionsResource extends BaseResource {
checkPermission(permission, false);
Context.getDataManager().linkObject(permission.getOwnerClass(), permission.getOwnerId(),
permission.getPropertyClass(), permission.getPropertyId(), false);
+ LogAction.unlink(getUserId(), permission.getOwnerClass(), permission.getOwnerId(),
+ permission.getPropertyClass(), permission.getPropertyId());
Context.getPermissionsManager().refreshPermissions(permission);
return Response.noContent().build();
}