mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-20 14:06:27 +00:00
132eb2035f
Permissions: stored levels are validated at load (corrupt/out-of-range rows fall back to the default consistently across all readers), the load-error swallow is narrowed to missing-table (anything else logs), and an all-skipped save no longer opens a transaction or flushes the cache. The module-scoped cache stays by design (shared DI+bridge invalidation), and the checkPermission 'admin' case stays — it is reachable (correct deny for non-admins on admin-level actions), not dead code. Audit: data/logs creation is lazy (no import-time disk side effect; the LOG_LEVEL freeze remains — tests/setup.ts timing contract), the log helpers gate on a real severity threshold (error < warn < info < debug; prod default 'info' unchanged), file-IO failures leave a console.error trace instead of vanishing in bare catches, and resolveUserEmail treats only null/undefined as anonymous so a real id 0 resolves via the DB.