Skip to content

Studio search (Meilisearch) does not include courses for authz-only users #417

Description

@wgu-taylor-payne

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.

Activity

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

Metadata

Metadata

Labels

willowReleased in Willow

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions