Fix: Create SearchAccess on library creation for course creator search access#38091
Merged
UsamaSadiq merged 3 commits intoopenedx:masterfrom Mar 5, 2026
Merged
Conversation
…h access When a course creator creates a new library, the SearchAccess record must exist immediately so their JWT token can include the library's access_id. Without this, course creators cannot see newly added components in search results until the page is refreshed. This issue doesn't affect superusers who bypass access_id filtering.
b3bbc4a to
5d6fc06
Compare
muhammadali286
approved these changes
Mar 5, 2026
UsamaSadiq
approved these changes
Mar 5, 2026
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.
Problem
When a course creator (non-superuser) creates a new content library and immediately tries to add components, the UI doesn't update to show the newly added component in search results. This happens because:
access_idfilters to restrict search results to libraries/courses the user has permission to accessSearchAccessrecords were only created during document indexing (in_meili_access_id_from_context_key)SearchAccessrecord existsaccess_id, so Meilisearch filters it outSolution
Create the
SearchAccessrecord immediately when a library is created in thecontent_library_created_handler. This ensures:SearchAccessrecord exists before any components are addedaccess_idTesting Instructions
Prerequisites
Manual Testing
Authoring MFE PR
Refreshes JWT token after library creation