Who agreed to what, when and how. Entries are never changed or removed (after an account is deleted they stay, without the IP address).
{error &&
{error}
}
{!data ?
Loading…
: data.rows.length === 0 ?
Nothing recorded yet.
: (
{type === "news" && (
<>
When
Person
Channel
Choice
How
{(data.rows as NewsRow[]).map(r => (
{fmt(r.at)}
{r.name || No account}
{r.email}
{r.channel === "whatsapp" ? "WhatsApp" : "Email"}
{r.granted ? Opted in : Opted out}
{SOURCE[r.source] || r.source}{r.ip ?
{r.ip}
: null}
))}
>
)}
{type === "notice" && (
<>
When
Person
Version
How
{(data.rows as NoticeRow[]).map(r => (
{fmt(r.at)}
{r.name}
{r.email}
{r.version === 0 ? "Built-in" : r.version}
{SOURCE[r.source] || r.source}{r.ip ?
{r.ip}
: null}
))}
>
)}
{type === "parental" && (
<>
When
Child · event
Answer
Signed by
Wording
{(data.rows as ParentalRow[]).map(r => (
{fmt(r.at)}
{r.child}
{r.event}
{r.status === "given" ? Given : Declined}{r.photoConsent != null &&
Photos: {r.photoConsent ? "yes" : "no"}
}
{r.signedName || "—"}{r.ip ?
{r.ip}
: null}
v{r.textVersion}{r.medicalDeleted &&
medical details deleted
}
))}
>
)}
)}
{data && }
);
}
// ─── Access log ───────────────────────────────────────────────────────────────
type AccessRow = { id: string; at: string; actor: string; actorRole: string; action: string; what: string; records: number | null; ip: string | null; sensitive: boolean };
type AccessResponse = LogResponse & { actions: Record; actors: { id: string; name: string }[] };
/** Admin → Privacy → Access log: who took personal information out of the system in bulk. */
export function AccessLogPanel({ token }: { token: string }) {
const [action, setAction] = useState("");
const [actorId, setActorId] = useState("");
const [sensitiveOnly, setSensitiveOnly] = useState(false);
const [page, setPage] = useState(1);
const [data, setData] = useState(null);
const [error, setError] = useState(null);
const load = useCallback(async () => {
try {
const params = new URLSearchParams({ page: String(page) });
if (action) params.set("action", action);
if (actorId) params.set("actorId", actorId);
if (sensitiveOnly) params.set("sensitive", "true");
setData(await apiFetch(`/api/privacy/access-log?${params}`, { authToken: token }));
setError(null);
} catch (e) {
setError(errorMessage(e) || "Could not load the access log.");
}
}, [token, action, actorId, sensitiveOnly, page]);
useEffect(() => { load(); }, [load]);
return (
Every time someone downloads, emails or opens personal information in bulk — reports, attendance registers, certificates, group lists,
form answers, the consent and medical lists, backups — and every time an admin views the site as someone else.