new features

This commit is contained in:
Matthias Hochmeister
2026-03-23 17:45:51 +01:00
parent 0ffa6feb4c
commit 4c323748fd

View File

@@ -241,7 +241,17 @@ class AuditService {
if (admins.length === 0) return;
const titel = sensitiveActions[entry.action] || 'Benutzer-Änderung';
const nachricht = `${entry.action} auf ${entry.resource_type}${entry.resource_id ? ' ' + entry.resource_id : ''} durch ${entry.user_email ?? 'System'}`;
let nachricht: string;
if (entry.action === 'PERMISSION_DENIED') {
const meta = entry.metadata as Record<string, unknown> | undefined;
const perm = meta?.required_permission ?? '?';
const path = meta?.attempted_path ?? '';
const method = meta?.attempted_method ?? '';
nachricht = `${entry.user_email ?? 'Unbekannt'}: ${method} ${path} — benötigt "${perm}"`;
} else {
nachricht = `${entry.action} auf ${entry.resource_type}${entry.resource_id ? ' ' + entry.resource_id : ''} durch ${entry.user_email ?? 'System'}`;
}
for (const admin of admins) {
// Don't notify the admin about their own actions