Scope
- Consume the
permissions field from CourseMetadataView and make it available through a context or store.
- Create a reusable hook, e.g.
useCoursePermission('courses.enroll_learners').
- Create a guard component, e.g.
<PermissionGate permission="…">, that hides or disables content according to the design.
- Handle backend
403s consistently (toast or error state), in case frontend and backend disagree.
- Handle routing: if a user opens a tab directly without permission, redirect them or show a "no access" state.
Acceptance criteria
Blocked by: #486 and the design of the "no permission" states
Scope
permissionsfield fromCourseMetadataViewand make it available through a context or store.useCoursePermission('courses.enroll_learners').<PermissionGate permission="…">, that hides or disables content according to the design.403s consistently (toast or error state), in case frontend and backend disagree.Acceptance criteria
Blocked by: #486 and the design of the "no permission" states