diff options
Diffstat (limited to 'src/org/traccar/api/BaseObjectResource.java')
-rw-r--r-- | src/org/traccar/api/BaseObjectResource.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/api/BaseObjectResource.java b/src/org/traccar/api/BaseObjectResource.java index 634957a49..806c78624 100644 --- a/src/org/traccar/api/BaseObjectResource.java +++ b/src/org/traccar/api/BaseObjectResource.java @@ -31,6 +31,7 @@ import org.traccar.database.BaseObjectManager; import org.traccar.database.ExtendedObjectManager; import org.traccar.database.ManagableObjects; import org.traccar.database.SimpleObjectManager; +import org.traccar.helper.LogAction; import org.traccar.model.BaseModel; import org.traccar.model.Command; import org.traccar.model.Device; @@ -80,8 +81,10 @@ public abstract class BaseObjectResource<T extends BaseModel> extends BaseResour BaseObjectManager<T> manager = Context.getManager(baseClass); manager.addItem(entity); + LogAction.create(getUserId(), entity); Context.getDataManager().linkObject(User.class, getUserId(), baseClass, entity.getId(), true); + LogAction.link(getUserId(), User.class, getUserId(), baseClass, entity.getId()); if (manager instanceof SimpleObjectManager) { ((SimpleObjectManager<T>) manager).refreshUserItems(); @@ -107,6 +110,7 @@ public abstract class BaseObjectResource<T extends BaseModel> extends BaseResour Context.getPermissionsManager().checkPermission(baseClass, getUserId(), entity.getId()); Context.getManager(baseClass).updateItem(entity); + LogAction.edit(getUserId(), entity); if (baseClass.equals(Group.class) || baseClass.equals(Device.class)) { Context.getPermissionsManager().refreshDeviceAndGroupPermissions(); @@ -128,6 +132,7 @@ public abstract class BaseObjectResource<T extends BaseModel> extends BaseResour BaseObjectManager<T> manager = Context.getManager(baseClass); manager.removeItem(id); + LogAction.remove(getUserId(), baseClass, id); if (manager instanceof SimpleObjectManager) { ((SimpleObjectManager<T>) manager).refreshUserItems(); |