Fix XBlock studio handler silently dropping Course Editor writes
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 66/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start in views/component.py at component_handler around line 567 and trace how it checks course edit permission and calls update_item. Read the existing handler tests and add coverage for Course Editor writes and callers whose changed fields must receive 403. Done means permitted edits persist and unauthorized changed requests no longer return success.
索引モデルが issue の本文から書いたものです。
説明
Description
When an XBlock studio handler (e.g. Drag and Drop, Survey) is called by a Course Editor, the changes are not persisted, yet the handler returns 200 and the UI reports success. This is silent data loss.
Current Behavior
component_handler (views/component.py:567) decides whether to persist using the legacy has_course_author_access. Editors have no legacy role (LEGACY_COURSE_ROLE_EQUIVALENCES does not include them), so update_item is skipped and only a warning is logged. The response is still 200.
Expected Behavior
Editors' changes are persisted. Callers without permission get an explicit 403 instead of a fake success.
Steps to reproduce
- Log in as a Course Editor.
- Edit a Drag and Drop (or Survey) component and save.
- Observe the success message, then reload and see the change was not saved.
Acceptance Criteria
-
component_handlerpersists withupdate_itemwhenuser_has_course_permission(request.user, COURSES_EDIT_COURSE_CONTENT.identifier, usage_key.course_key, LegacyAuthoringPermission.WRITE)is true. - When the user lacks permission and the handler changed fields, the response is 403 rather than a silent 200.
- Editor edits to these XBlocks persist.
- Tests are added or updated.
Proposed Solution
if user_has_course_permission(
request.user, COURSES_EDIT_COURSE_CONTENT.identifier,
usage_key.course_key, LegacyAuthoringPermission.WRITE,
):
modulestore().update_item(block, request.user.id, asides=asides)
The else branch should return 403, at least when the handler actually changed fields.
- 主要言語
- Python
- スター
- 0
- フォーク
- 10
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openedx/openedx-authz のほかの issue
-
willow
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openedx/openedx-authz#604 ·
メンテナーはふだん 1 日以内に返信
-
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 が 2 日前に担当しました。 オープンwillow
openedx/openedx-authz#609 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Update Willow BTR test descriptions for current AuthZ behavior対応中かも @mariajgrimaldi が 2 日前に担当しました。 オープンwillow
openedx/openedx-authz#608 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
openedx/openedx-authz の issue をすべて見る
似ている issue
-
community enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
NVIDIA/auto-ontology#463 ·
メンテナーはふだん 1 日以内に返信
-
Update Atari link on Gymnasium docs page対応中かも @qwist1233-cpu が今日担当しました。 オープンhelp wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Farama-Foundation/Gymnasium#1845 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 91/100
WingedGuardian/GENesis-AGI#4101 ·
メンテナーはふだん 1 日以内に返信