Require publish permission when a save request publishes content
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Read _get_xblock_authz_permission and _check_xblock_permission in view_handlers.py, then trace _save_xblock and the existing tests for xblock save permissions. Add or update tests for content edits, make_public, and republish on eligible blocks, including requests that need both permissions. Done means the tests confirm publishing requires publish permission while correctly privileged pure edits and publishes still work; the visibility decision in the issue remains unresolved.
索引モデルが issue の本文から書いたものです。
説明
Description
A Course Editor can publish content without having publish_course_content by adding content fields to a request that also sets publish. The permission is chosen from the shape of the request body instead of from what the request does. This is backend only and needs a direct API call.
Current Behavior
_get_xblock_authz_permission (view_handlers.py:216-229) asks for publish_course_content only on a "pure" publish. If the body contains any content field (_CONTENT_FIELDS, :109), it asks for edit_course_content instead. _save_xblock then publishes anyway (:696-702).
Expected Behavior
Any request that will publish requires publish permission, in addition to edit permission when it carries content.
Steps to reproduce
- Log in as a Course Editor (has edit but not publish permission).
- Send an xblock save request to the xblock handler with
publish: "make_public"plus a content field such asmetadata. - Observe that the block is published.
Acceptance Criteria
- A request that publishes (
make_public, orrepublishon a non-direct-only block with a published version) requiresPUBLISH_COURSE_CONTENT. - A request with content fields requires
EDIT_COURSE_CONTENT; a request with both requires both. - An Editor sending content plus
make_publicno longer publishes. - Pure edits and pure publishes by correctly-privileged users keep working.
- Tests are added or updated.
Proposed Solution
needs_publish = publish == "make_public" or (
publish == "republish"
and block_type not in DIRECT_ONLY_CATEGORIES
and modulestore().has_published_version(xblock)
)
Have _get_xblock_authz_permission return a list and _check_xblock_permission require all of them.
Notes or Additional Context
Product decision needed: an editor changing visibility on a published unit. Either deny it (403), or save the change as a draft and downgrade republish to no publish. Second opinion requested on the API-level security validation.
- 主要言語
- Python
- スター
- 0
- フォーク
- 10
- 平均マージ
- 3日 19時間
- マージ済み PR(30日)
- 22
環境構築
- 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
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
openedx/openedx-authz#605 ·
メンテナーはふだん 1 日以内に返信
-
willow
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
openedx/openedx-authz#602 ·
メンテナーはふだん 1 日以内に返信
openedx/openedx-authz の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
cline/mcp-marketplace#3576 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
griptape-ai/griptape-nodes-library-elevenlabs#30 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
awslabs/social-messaging-agent-runtime-toolkit#140 ·
メンテナーはふだん 1 日以内に返信
-
subtask
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fga-eps-mds/2026.2-MeasureSoftGram-DOC#187 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
NSPG13/agent-bounties#1747 ·
メンテナーはふだん 1 日以内に返信