Context
PR #1102 introduces a client-side RBAC system with course ownership, content locking, and a lecturer management panel. It is intentionally client-side only as a foundation. This issue tracks what needs to change to make it production-grade.
Server-side enforcement
The current implementation relies on client-side checks. A determined user could bypass locks by inspecting network requests or manipulating JavaScript. For production:
Auth integration
Lecturer panel enhancements
Quiz integration
Mobile support
Testing
Documentation
🤖 Generated with Claude Code
Context
PR #1102 introduces a client-side RBAC system with course ownership, content locking, and a lecturer management panel. It is intentionally client-side only as a foundation. This issue tracks what needs to change to make it production-grade.
Server-side enforcement
The current implementation relies on client-side checks. A determined user could bypass locks by inspecting network requests or manipulating JavaScript. For production:
tutors_content_locksso only lecturers listed in the course can write lock state. This requires migrating from the Supabase anon key to authenticated sessions (either Supabase Auth or passing the Auth.js JWT to Supabase).afterNavigate(client-side) to SvelteKit server hooks or+page.server.tsload functions so locked content URLs return 403 rather than relying on client-side redirects.tutors.json— the client just hides it. For truly sensitive content (e.g., quiz answers), consider serving locked content separately and only delivering it when unlocked.Auth integration
devflag auto-creates a lecturer identity when noowner/lecturersis configured. This should be removed or gated behind an explicit env var before production deployment.tutorsId.value?.login(from Auth.js GitHub OAuth) againstcourse.properties.owner. This is sound but the comparison is case-insensitive string matching — consider normalizing GitHub logins consistently.properties.yaml(static, requires redeployment to change). Consider acourse_ownersSupabase table for runtime ownership changes without redeploying course content.Lecturer panel enhancements
tutors.json). Add the ability for lecturers to manage the allowlist at runtime via a Supabasecourse_enrollmenttable.learning_recordsandcalendarSupabase tables.Quiz integration
isLecturerto ensure only course owners can manage quiz sessions.Mobile support
hidden md:block). Add a mobile-friendly trigger — either in the hamburger menu or as a floating action button.Testing
CREATE TABLE tutors_content_locksSQL in the staging Supabase instance.loadLocks,toggleLock, localStorage fallback, Supabase sync.Documentation
ownerandlecturersproperties in the tutors reference manual — how to set them, what they enable, expected format.🤖 Generated with Claude Code