Description
Users who have only an authz role assignment (e.g., course_editor or course_auditor) without a corresponding legacy CourseStaffRole or CourseInstructorRole are invisible to the Meilisearch search access filter. This means course content does not appear in:
- The global Studio search modal (Cmd+K / magnifying glass icon)
- The "Review Content Updates" tab on the Library Updates page (
/course/{id}/libraries)
Root Cause
get_access_ids_for_request builds the Meilisearch tenant token filter using only legacy CourseStaffRole/CourseInstructorRole assignments:
course_clause = models.Q(context_key__in=[
role.course_id
for role in course_roles
if role.role in [CourseInstructorRole.ROLE, CourseStaffRole.ROLE]
])
Users with authz-only roles do not have entries in the legacy CourseAccessRole table, so their courses are excluded from the access_id filter embedded in the JWT tenant token. Meilisearch enforces this filter server-side, returning zero results for any course not in the list.
Expected Behavior
When AUTHZ_COURSE_AUTHORING_FLAG is enabled, get_access_ids_for_request should also include courses where the user has an authz role assignment (any course-scoped role), so that search results are visible to editors and auditors.
Affected Pages
- Global Studio search modal (search icon in header / Cmd+K)
- Library Updates page → "Review Content Updates" tab (uses Meilisearch to look up component details)
Context
Originally reported in #398 (comment) during testing of the view_library_updates enforcement PR.
This is a broader issue than library updates — it affects all Meilisearch-powered features for any authz-only user who lacks an org-level role.
Suggested Fix
In openedx/core/djangoapps/content/search/models.py, update get_access_ids_for_request to query authz role assignments when the feature flag is enabled and include those course keys in the access_ids list.
Description
Users who have only an authz role assignment (e.g.,
course_editororcourse_auditor) without a corresponding legacyCourseStaffRoleorCourseInstructorRoleare invisible to the Meilisearch search access filter. This means course content does not appear in:/course/{id}/libraries)Root Cause
get_access_ids_for_requestbuilds the Meilisearch tenant token filter using only legacyCourseStaffRole/CourseInstructorRoleassignments:Users with authz-only roles do not have entries in the legacy
CourseAccessRoletable, so their courses are excluded from theaccess_idfilter embedded in the JWT tenant token. Meilisearch enforces this filter server-side, returning zero results for any course not in the list.Expected Behavior
When
AUTHZ_COURSE_AUTHORING_FLAGis enabled,get_access_ids_for_requestshould also include courses where the user has an authz role assignment (any course-scoped role), so that search results are visible to editors and auditors.Affected Pages
Context
Originally reported in #398 (comment) during testing of the
view_library_updatesenforcement PR.This is a broader issue than library updates — it affects all Meilisearch-powered features for any authz-only user who lacks an org-level role.
Suggested Fix
In
openedx/core/djangoapps/content/search/models.py, updateget_access_ids_for_requestto query authz role assignments when the feature flag is enabled and include those course keys in theaccess_idslist.