SORMAS-Project icon indicating copy to clipboard operation
SORMAS-Project copied to clipboard

Write permanent deletion of entities to audit log [1]

Open MartinWahnschaffe opened this issue 3 years ago • 0 comments

Problem Description

The main write mechanism for the audit log is currently based on an interceptor that logs calls to the backend. In addition to that the history tables document the complete history of the creation and manipulation of data in the system. Both mechanisms don't work for the permanent deletion of entities, because permanent deletion also deletes the history AND permanent deletion is handled within scheduled logic in the backend that is not triggered for every single entity.

Proposed Change

Add an explicit log call when entities are deleted permanently.

Acceptance Criteria

  • When a case is automatically deleted this leads to log entries for the case itself and all related core entities that are deleted. The log entry contains the uuid of the entity.

Implementation Details

  • [ ] Call the AuditLogger.logBackendCall method from within the deletePermanent method of the BaseAdoService

Alternative

Use the existing AuditLogInterceptor mechanism and exempt calls to deletePermanent from the "don't log calls to local beans" rule.

MartinWahnschaffe avatar Jul 18 '22 13:07 MartinWahnschaffe