openedx / openedx/openedx-authz

Course Optimizer endpoints ignore authz permissions

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

@dcoa is already working on this.

Since Sep 17, 2026.

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

Description

Description

The Course Optimizer endpoints still rely on the legacy authorization system (course roles), while the frontend already validates access to the tool using authz permissions (course content edit permission). This creates an inconsistency: the menu may show the tool as available, but the endpoint calls fail for users who only hold authz roles.

Current Behavior

The four Course Optimizer endpoints (link_check, link_check_status, rerun_link_update, rerun_link_update_status) validate permissions using Studio's legacy role system. A user with an authz course editor role (but no legacy role and not global staff) cannot use the tool: requests return 403 Forbidden even though the frontend lets them attempt it.

Expected Behavior

The endpoints should validate the authz courses.edit_course_content permission, so that any role (authz or legacy) granting that permission allows use of the Course Optimizer. A user with an authz editor role should be able to start a scan and check/update results without getting a 403.

Steps to Reproduce
  1. Create a test course and turn on the contentstore.enable_course_optimizer flag (Force On) for that course.
  2. Turn on authz for the same course (authz.enable_course_authoring, Force On).
  3. Create a user who is not global staff and has no legacy course roles, and assign them an authz course editor role.
  4. Log in to the authoring MFE as that user and open the course.
  5. Go to Tools → Course Optimizer and try to start a scan (POST /api/contentstore/v0/link_check/<course_id>).
  6. Observe that the request returns 403, even though the user has edit permission via authz.

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.