feat: granular file access audit logging (viewed/opened/downloaded)
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled

Replace single FILE_DOWNLOADED action with three granular actions:
- FILE_VIEWED: inline preview loaded in the UI
- FILE_OPENED: file opened in a new browser tab
- FILE_DOWNLOADED: explicit download button clicked

Add 'purpose' field to getDownloadUrl input (preview/open/download).
All client callers updated to pass the appropriate purpose.
Audit page updated with new filter options and color mappings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 18:18:28 +01:00
parent 503a375701
commit c8c26beed2
6 changed files with 32 additions and 15 deletions

View File

@@ -77,6 +77,8 @@ const ACTION_TYPES = [
'ROUND_ARCHIVED',
'UPLOAD_FILE',
'DELETE_FILE',
'FILE_VIEWED',
'FILE_OPENED',
'FILE_DOWNLOADED',
'BULK_CREATE',
'BULK_UPDATE_STATUS',
@@ -171,6 +173,8 @@ const actionColors: Record<string, 'default' | 'destructive' | 'secondary' | 'ou
ROUND_ACTIVATED: 'default',
ROUND_CLOSED: 'secondary',
ROUND_ARCHIVED: 'secondary',
FILE_VIEWED: 'outline',
FILE_OPENED: 'outline',
FILE_DOWNLOADED: 'outline',
ROLE_CHANGED: 'secondary',
PASSWORD_SET: 'outline',