Add a course permission check to ContainerChildrenView
Maintainers usually reply within 1 day
@BryanttV is already working on this.
Since Nov 11, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- authorization, backend-api-design, testing
Research direction
Start in rest_api/v1/views/course_index.py at ContainerChildrenView.get() and compare its access check with ContainerHandlerView. Add or update tests for a user without course access and confirm the request returns 403 before get_xblock can create course info blocks. Verify an authorized user can still load the unit page.
Written by the indexing model from the issue text.
Description
Description
ContainerChildrenView does not check course access, so any authenticated user can request a container's children. It is backend only and needs a direct API call.
Current Behavior
rest_api/v1/views/course_index.py:125 only applies view_auth_classes(is_authenticated=True). Unlike its sibling ContainerHandlerView, it never calls _get_item_in_course, so no course access check runs. This also happens with the legacy access checks, and was already the case upstream.
Expected Behavior
Only users with view access to the course can list a container's children.
Steps to reproduce
Setup
- A course with at least one unit (vertical).
- A user with no access to that course: authenticated, not course staff, and with no AuthZ role on it.
Steps
-
In Studio, open any unit of the course as a user with access and copy its usage key from the URL, for example
block-v1:Org+Course+Run+type@vertical+block@abc123. -
Log in to Studio as the user with no access to the course.
-
Call the endpoint with that usage key (URL-encoded):
GET /api/contentstore/v1/container/{usage_key_string}/children -
Observe the response.
Result
- Actual:
200, with the container's children in the body. - Expected:
403.
For comparison, GET /api/contentstore/v1/container_handler/{usage_key_string} as the same user returns 403, because it goes through _get_item_in_course.
Acceptance Criteria
-
get()returns 403 for users withoutCOURSES_VIEW_COURSEon the container's course. - The check runs before anything else in
get(). - The unit page keeps working, since
container_handleralready requires the same permission. - Tests are added or updated.
Proposed Solution
At the top of get():
if not user_has_course_permission(
request.user, COURSES_VIEW_COURSE.identifier,
usage_key.course_key, LegacyAuthoringPermission.READ,
):
self.permission_denied(request)
Technical Notes
get_xblock creates course_info blocks on a GET when they do not exist (view_handlers.py:1140), so the permission check has to come before that.
- Dominant language
- Python
- Stars
- 0
- Forks
- 10
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 25
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from openedx/openedx-authz
-
Allow Course Editors to import YouTube transcripts and surface errorsPossibly taken @efortish claimed this 7 days ago. Openwillow
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openedx/openedx-authz#597 · 1 assignee ·
Maintainers usually reply within 1 day
-
willow
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openedx/openedx-authz#579 ·
Maintainers usually reply within 1 day
-
Add `hidden` property to permission categories and permissionsPossibly taken @BryanttV claimed this 1 day ago. Open
openedx/openedx-authz#632 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
openedx/openedx-authz#631 ·
Maintainers usually reply within 1 day
-
Run performance tests on the Willow RBAC authorization flows in openedx-authz and openedx-platformOpen
Difficulty 5/5 Over a week Newbie friendliness 35/100
openedx/openedx-authz#630 ·
Maintainers usually reply within 1 day
All issues in openedx/openedx-authz
Similar issues
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps itPossibly taken @paulo-0308 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Diaoul/subliminal#1405 ·
-
Internal ErrorOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
frappe/frappe_docker#2071 ·
Maintainers usually reply within 1 day
-
🐛 Bug Report: OpenAI Responses: with_raw_response.create() raises when the body can't be parsed, though the uninstrumented call returnsPossibly taken A pull request linked to this issue is open or already merged. Openbug python
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
traceloop/openllmetry#4717 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
The-Pocket/PocketFlow#161 ·
-
comp/desktop P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#157702 ·
Maintainers usually reply within 1 day