Skip to content

Shared infrastructure and exposing permissions to the MFE #495

Description

@BryanttV

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

  • The hook and the guard have unit tests.
  • Current tab behavior doesn't change until the subtasks are implemented.

Blocked by: #486 and the design of the "no permission" states

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    willowReleased in Willow

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions