openedx / openedx/openedx-authz
Course Optimizer endpoints ignore authz permissions
- 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
- Create a test course and turn on the
contentstore.enable_course_optimizerflag (Force On) for that course. - Turn on authz for the same course (
authz.enable_course_authoring, Force On). - Create a user who is not global staff and has no legacy course roles, and assign them an authz course editor role.
- Log in to the authoring MFE as that user and open the course.
- Go to Tools → Course Optimizer and try to start a scan (
POST /api/contentstore/v0/link_check/<course_id>). - Observe that the request returns
403, even though the user has edit permission via authz.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.