feat(admin): Sprint 5 — Audit log + Settings (gouvernance)
This commit is contained in:
parent
2ad4cbed80
commit
79ddcd23f5
14 changed files with 773 additions and 24 deletions
|
|
@ -7,9 +7,10 @@ import { auth } from "@/auth";
|
|||
import { UserRole } from "@/generated/prisma/enums";
|
||||
import { requireRole } from "@/lib/authorization";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { recordAudit } from "@/lib/admin/audit";
|
||||
|
||||
async function audit(event: string, target: string, actor: string | null, details: unknown) {
|
||||
console.log(JSON.stringify({ scope: "admin.organizations", event, target, actor, details, at: new Date().toISOString() }));
|
||||
async function audit(event: string, target: string, actor: string | null, details: Record<string, unknown>) {
|
||||
await recordAudit({ scope: "admin.organizations", event, target, actorEmail: actor, details });
|
||||
}
|
||||
|
||||
const slugRe = /^[a-z0-9](?:[a-z0-9-]{0,80}[a-z0-9])?$/;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue