Add a course permission check to ContainerChildrenView
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
rest_api/v1/views/course_index.py の ContainerChildrenView.get() から始め、そのアクセスチェックを ContainerHandlerView のものと比較してください。コースへのアクセス権がないユーザーのテストを追加または更新し、get_xblock がコース情報ブロックを作成する前にリクエストが 403 を返すことを確認してください。認可されたユーザーが引き続きユニットページを読み込めることを検証してください。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 0
- フォーク
- 10
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openedx/openedx-authz のほかの issue
-
willow
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openedx/openedx-authz#597 ·
メンテナーはふだん 1 日以内に返信
-
willow
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openedx/openedx-authz#579 ·
メンテナーはふだん 1 日以内に返信
-
Willow release testing対応中かも @mariajgrimaldi が今日担当しました。 オープンwillow
openedx/openedx-authz#609 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Update Willow BTR test descriptions for current AuthZ behavior対応中かも @mariajgrimaldi が今日担当しました。 オープンwillow
openedx/openedx-authz#608 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
willow
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
openedx/openedx-authz#605 ·
メンテナーはふだん 1 日以内に返信
openedx/openedx-authz の issue をすべて見る
似ている issue
-
Remove the `pull_request_target` workflow before GitHub blocks it対応中かも @jat255 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
IBM/mcp-context-forge#7483 ·
メンテナーはふだん 2 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[Bug Report]: OpenAI 辅助 API 连通性测试因输出上限仅 1 token 误报“未知错误”対応中かも @fjfanjian が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Project-N-E-K-O/N.E.K.O#3640 ·
メンテナーはふだん 1 日以内に返信
-
author-page correction
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
acl-org/acl-anthology#10808 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信