openedx / openedx/openedx-authz

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

Open
#417 0 comments 0 reactions 1 assignee View on GitHub

@wgu-taylor-payne is already working on this.

Since Aug 24, 2026.

willow
Dominant language
Python
Stars
0
Forks
9
Avg merge
13d 9h
Merged PRs (30d)
9

Description

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 https://github.com/openedx/openedx-authz/issues/398#issuecomment-5369174404 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.