Repository navigation
Open
openedx/frontend-app-authoring
#3202Labels
willowReleased in Willow
Description
Description
This task covers the views and components related to Library Updates in the Authoring MFE. Users must only be able to use the actions allowed by both of these:
- Their course permissions: Course Auditors get a read-only experience, and Course Editors get management actions.
- Their access to the source library: as defined in the Library updates in Authoring product proposal, previewing, accepting, or ignoring an update also requires permission to view the source library.
Design: Figma
Current Behavior
- The Library Updates views do not offer a read-only experience for users who can view library updates but cannot manage them.
- They do not consider whether the user can view the source library of each update. The backend will reject preview, accept, and ignore requests from users without that access.
Expected Behavior
Course permissions
| Permission | Course Editor | Course Auditor |
|---|---|---|
courses.view_library_updates |
✅ | ✅ |
courses.manage_library_updates |
✅ | ❌ |
Resulting behavior per update
| Can view source library | Can manage updates | Preview | Accept / Ignore |
|---|---|---|---|
| ✅ | ✅ | Available | Enabled |
| ✅ | ❌ | Available | Visible but disabled, with a tooltip |
| ❌ | ✅ or ❌ | Replaced by a permission notice | See the table below |
Without access to the source library
| Surface | Behavior |
|---|---|
| Course outline | Keep the update notification, remove the Review button, and explain why the content remains unchanged. |
| Unit sidebar | Replace Review Updates with an explanation of the restriction. |
| Library Updates page | Keep the affected items visible, and replace the Review, Update (accept), and Ignore actions with a permission notice. |
| Preview modal | Replace the new version preview with a permission notice, and disable Accept changes and Ignore changes. |
Acceptance Criteria
Page access and navigation
- A user with
courses.view_library_updatescan open the Libraries page and the Review Content Updates tab. - The Libraries link in the course header menu is shown to users with
courses.view_library_updates. - A user without
courses.view_library_updatessees the existingPermissionDeniedAlert.
Read-only users with library access
- On each update card, Review Updates is enabled, and Update and Ignore are visible but disabled. They are not hidden.
- In the preview modal, Accept changes and Ignore changes are disabled, as are the variants for locally modified content (Update to published library content and Keep course content).
- Hovering over a disabled action shows:
Your role doesn't include permission to do this. Contact your org admin to request access - The out-of-sync alert does not promise accept or ignore actions. It says "Review updates to see what changed".
Library access
- Access to each source library is read from the
can_view_upstream_libraryfield of the downstreams summary (GET /api/contentstore/v2/downstreams/{course_key}/summary), and matched to each update by its library key. The frontend does not check library permissions on its own. - The check applies to every user, including those who have
courses.manage_library_updates. - While permissions and library access are loading, the UI does not briefly show actions or messages that then change.
- The UI does not request library preview content for a library the user cannot view.
Course outline without library access
- The update notification is still shown, without the Review button, with the message from the design. For one component: "1 library component is out of sync. Current content will remain unchanged until a member with review permissions accepts updates." The message handles plural counts.
- If pending updates come from several libraries and the user can view at least one of them, the notification keeps the Review button. The restriction is shown only on the blocked items.
Unit sidebar without library access
- The Review Updates action in the library reference card is replaced by the restriction explanation from the design.
Library Updates page without library access
- Affected items remain visible, and their Review Updates, Update, and Ignore actions are replaced by: "You do not have permission to review updates for this library. The course content will remain on its current version until a member with review permissions accepts the changes."
- Items from libraries the user can view keep the behavior that matches their course permissions.
Preview modal without library access
- The new version preview is replaced by the same permission notice.
- Accept changes and Ignore changes (and their variants for locally modified content) are disabled, with the tooltip shown in the design.
- This applies from every place that opens the modal, including the component sync action on the unit page.
Quality
- Tests cover all combinations of library access and course permissions on each surface, including a mix of accessible and restricted libraries.
- All new messages are translatable and include a description for translators.
Out of Scope
- Changes to the legacy Studio unit page.
- Backend enforcement, tracked separately.
Dependencies
- Backend issue: Require library view access to preview, accept, or ignore library updates #670. It requires library view access for preview, accept, and ignore, and adds
can_view_upstream_libraryto the downstreams summary. - feat(authz): implement permission validation in library update page frontend-app-authoring#3202 is the PR for this issue. Its scope now includes the library access rules.
- fix: pass course context to library review endpoints frontend-app-authoring#3251 should be closed. Preview access is no longer granted through the course, so feat(authz): implement permission validation in library update page frontend-app-authoring#3202 no longer depends on Fix review endpoints to allow access for users with
courses.view_library_updatespermission #441.
Technical Notes
- Component preview: the Old version tab can stay as it is. The preview modal passes the course block key as
oldUsageKey, so that tab renders course content and does not depend on library access. Only the New version content needs the permission notice. - Container preview:
CompareContainersWidgetshows Before (course data) and After (library data) side by side. A failed library request currently replaces the whole comparison with an error, and the Before list is only built once both responses are available. Without library access, Before should still show the course content, and the permission notice should replace After, without requesting library data. - Several libraries can have pending updates in one course. The downstreams summary returns one item per source library, so one request covers all of them. Verify that every affected surface can use it.
Metadata
Metadata
Assignees
Labels
willowReleased in Willow
Type
Projects
- StatusShow more project fieldsIn Progress
Activity
BryanttV commentedon Aug 10, 2026
Hi @dcoa, could you help me refine this issue? It seems to me that we'll also need to add a new read-only permission here.
cc @gviedma-aulasneo
dcoa commentedon Aug 11, 2026
Yes, we should add a view permission to distinguish unauthorized users from Course Auditors.
Refinement
Acceptance criteria
courses.view_library_updates(but withoutcourses.manage_library_updates)can open the Libraries page and the "Review Content Updates" tab.
disabled.
locally-modified variants "Update to published library content" / "Keep course
content") are disabled for read-only users.
Your role doesn't include permission to do this. Contact your org admin to request accessis allowed.
courses.view_library_updatesstill gets the existingPermissionDeniedAlert.permission (so view-only users can actually reach the page).
Implementation tasks (frontend-app-authoring)
1. Authz plumbing
src/authz/constants.ts: addVIEW_LIBRARY_UPDATES: 'courses.view_library_updates'.src/authz/permissionHelpers.ts: addcanViewLibraryUpdatestogetLibraryUpdatesPermissions()(view + manage, both course-scoped).src/authz/permissionHelpers.test.ts: update the assertion for the new shape.2. Read-only message
src/generic/messages.ts: addreadOnlyTooltipwith the exact copy above(description included for translators). Shared so both the review tab and the
preview modal use the same string.
3. Page gating + read-only propagation
src/course-libraries/CourseLibraries.tsx:canViewLibraryUpdates(PermissionDeniedAlert otherwise);readOnly = !canManageLibraryUpdates;readOnlytoReviewTabContent.src/header/hooks.tsx: show the "Libraries" content-menu link based oncanViewLibraryUpdatesinstead ofcanManageLibraryUpdates.4. Review tab card actions
src/course-libraries/ReviewTabContent.tsx:readOnlythroughReviewTabContent→ItemReviewList;LoadingButton) and "Ignore" buttons when read-only;OverlayTrigger/Tooltip(via a<span>, theestablished pattern from
src/course-unit/add-component/add-component-btn);readOnlyinto the preview modal.5. Preview modal
src/course-unit/preview-changes/index.tsx:readOnlyprop (defaultfalse) so existing callers(
OutlineNode.tsx,LibraryReferenceCard.tsx, iframe wrapper) are unaffected;modified variants "Update to published library content"/"Keep course content".
6. Tests
src/course-libraries/CourseLibraries.test.tsx:canViewLibraryUpdates: true;canViewLibraryUpdates: false;preview modal buttons disabled with tooltip for read-only user.
src/course-unit/preview-changes/index.test.tsx: render modal directly withreadOnlyand assert disabled buttons + tooltip.src/header/hooks.test.tsx: mocks switched tocanViewLibraryUpdates.dcoa commentedon Aug 25, 2026
I want to verify one last thing here and that is the out of sync Alert that is displayed in the course outline and libraries updates. There is not indication of what to do with it for Course Auditor in the Figma, and keep it does not cause any harm because it redirects to Library Updates page. However, I feel the message misleading for that specific role because it says "Review updates to accept or ignore changes" -> Action that cannot perform
I wonder if we would like to keep it as it is, or we should either hide the Alert or remove the review part of message for read only permissions.
@BryanttV @gviedma-aulasneo
gviedma-aulasneo commentedon Aug 27, 2026
@dcoa Do we use that message somewhere else? If not, I think we can change the last sentence to 'Review updates to see what changed' and it may be less misleading.
BryanttV commentedon Dec 3, 2026
Hi @dcoa, the is the PR with the changes needed for library updates in the Backend. According to the product proposal, we can move forward with the changes on the Frontend.