Settings

Data, access, and export preferences

Role-based access

The schema supports OWNER, EDITOR, and VIEWER roles on every User. Gate write routes (POST/PATCH/DELETE under /api) by checking the session role from getServerSession(authOptions) before mutating data.

Audit log

Every create, update, and delete writes an AuditLog row with a diff. Build a table page reading prisma.auditLog.findMany ordered by createdAt desc to surface it in the UI.