Add client-side RBAC with course ownership and content locking - #1102
Open
lgriffin wants to merge 4 commits into
Open
Add client-side RBAC with course ownership and content locking#1102lgriffin wants to merge 4 commits into
lgriffin wants to merge 4 commits into
Conversation
Press ? on any page to see a context-aware keyboard shortcuts reference. Shows general shortcuts plus section-specific ones for labs (arrow key step nav), presentations (slide nav), and notebooks (cell nav). Uses native <dialog> with showModal() for proper focus trapping and backdrop. Arrow keys are suppressed in content components while the overlay is open. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Press F to hide the navigation bar and footer for distraction-free reading. Press F again to restore them. Uses the existing hideMainNavigator rune. Added to the keyboard shortcuts overlay and all 5 i18n locales. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Floating button appears after scrolling 400px, respects reduced motion preference. T key scrolls to top from anywhere. Both registered in the keyboard shortcuts overlay with i18n support across all 5 locales. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduce a role-based access control system that allows lecturers to lock and unlock course content at runtime. Lecturers are identified by matching their GitHub login against owner/lecturers properties set in the course configuration. - Add isLecturer, courseLecturers, and contentLocks reactive runes - Extract owner/lecturers from course.properties on course load - Create RBAC service with lock state management (Supabase + localStorage fallback) - Add Supabase client functions for content lock CRUD and learning records query - Add lock overlay on Cards and Units (greyed out with lock icon for students) - Add inline lock toggle buttons visible only to lecturers - Create LecturerButton nav component and LecturerPanel sidebar with content locks tree, enrollment viewer, and access analytics tabs - Add route guard to prevent direct navigation to locked content - Add lock, unlock, and lecturer icons to all four theme icon sets - Add L keyboard shortcut to toggle lecturer/student view in dev mode Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@lgriffin is attempting to deploy a commit to the Jordan Harrison Team on Vercel. A member of the Team first needs to authorize it. |
19 tasks
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a client-side role-based access control (RBAC) system enabling lecturers to manage course content visibility at runtime. This is a foundational step toward giving course owners control over student progression — locking/unlocking topics, units, and individual learning objects, and gating capabilities like quizzes.
How it works
owner: github-loginand/orlecturers: login1,login2in their courseproperties.yaml. On load, the app compares these against the authenticated user's GitHub login to determine lecturer status.tutors_content_locks) with a localStorage fallback, so it works locally without Supabase and degrades gracefully.Key design decisions
authLevel,whitelist,isPrivateare all client-side today). No server-side API routes or Supabase RLS.npm run devand noowner/lecturersis configured, a dev lecturer identity is auto-created. PressLto toggle between lecturer and student views for testing.New files
src/lib/services/rbac/— types, lock management service, re-exportssrc/lib/ui/navigators/buttons/LecturerButton.svelte— nav bar sidebar triggersrc/lib/ui/learning-objects/content/LecturerPanel.svelte— sidebar panel with locks/enrollment/analyticsModified files
runes.svelte.ts—isLecturer,courseLecturers,contentLocksruneslo-tree.ts— lecturer extraction from course properties(course-reader)/+layout.svelte— lecturer computation, lock loading, route guardsupabase-client.ts— lock CRUD and learning records queryCards.svelte,Units.svelte— lock overlay and toggle UIMainNavigator.svelte— conditional LecturerButtonkeyboard-shortcuts.ts,en.ts,TutorsShell.svelte— L shortcut for dev view toggleSupabase table required
The feature degrades gracefully without this table (uses localStorage only).
Test plan
owner: your-github-loginin a test course'sproperties.yamlLto toggle lecturer/student view🤖 Generated with Claude Code
Related
Tracks production hardening in #1103