POPIA toolkit part 2: privacy notice editor, operators, consent and access logs

- Admin -> Privacy (POPIA): edit the privacy notice (built-in text as the
  start, placeholders for org/IO/operators), drafts, preview, numbered
  versions; earlier versions readable on /legal/privacy?version=N
- "Significant change" versions are accepted once after login
  (NoticePrompt); sign-up records the version accepted
- Operator register (seeded with the services the app uses), listed in
  the notice via {operators}
- Consent log (news opt-ins, notice acceptances, parental consent) and
  access log (report exports, registers, certificates, group lists, form
  answers, consent/medical lists, backups, impersonation)
- Information Officer on the contact page
- Unit tests (privacyNotice.test.js), e2e (privacy-notice.spec.ts); docs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mt6TCv85T9VKRq3cV7rXq
This commit is contained in:
2026-10-23 19:11:20 +02:00
co-authored by Claude Opus 5.5
parent 40c5c9cc1d
commit d265047c84
40 changed files with 2328 additions and 324 deletions
+22 -1
View File
@@ -1,6 +1,7 @@
"use client";
import { Mail, Phone, MapPin } from "lucide-react";
import Link from "next/link";
import { Mail, Phone, MapPin, ShieldCheck } from "lucide-react";
import { Navbar } from "@/components/layout/Navbar";
import { Footer } from "@/components/layout/Footer";
import { useSiteSettings } from "@/contexts/SiteSettingsContext";
@@ -13,6 +14,8 @@ export default function ContactPage() {
const email = settings.org_email || "";
const phone = settings.org_phone || "";
const address = settings.org_address || "";
const ioName = settings.legal_io_name || "";
const ioEmail = settings.legal_io_email || "";
const hasAny = !!(email || phone || address);
return (
@@ -75,6 +78,24 @@ export default function ContactPage() {
<LocationMap address={address} />
</div>
)}
{/* POPIA: the Information Officer, once one is set in Site Settings → Legal. */}
{ioName && (
<div className="mt-8 flex items-start gap-3 border rounded-xl p-5 bg-white shadow-sm">
<div className="w-10 h-10 rounded-full bg-brand-50 flex items-center justify-center shrink-0">
<ShieldCheck className="w-5 h-5 text-brand-600" />
</div>
<div className="text-sm text-gray-600">
<div className="font-semibold text-gray-900">Privacy and your personal information</div>
<p className="mt-1">
Our Information Officer is <strong>{ioName}</strong>
{ioEmail && <> — <a href={`mailto:${ioEmail}`} className="text-brand-600 hover:underline break-all">{ioEmail}</a></>}.
Contact them about the information we hold about you, or see our{" "}
<Link href="/legal/privacy" className="text-brand-600 hover:underline">privacy notice</Link>.
</p>
</div>
</div>
)}
</main>
<Footer />
</div>