New content-library response serializes can_edit_library without request context
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 openedx/core/djangoapps/content_libraries/rest_api/libraries.py 中的 LibraryRootView.post 和 serializers.py 中的权限方法开始。以创建者身份复现库的创建,然后将其 can_edit_library 值与创建者、读者和被拒绝的调用方执行的详情 GET 进行比较。完成的标准是创建响应反映创建者的实际权限,同时不削弱授权控制。
由索引模型根据 Issue 内容生成。
描述
Checked 2026-09-30: master source at ca039029e4918f02903b1c7d62adf8b3ad74f75b and release/verawood source at 18ce9a9c2b20c745b0ee94f615c13855acd9624b. Both carry this code path. This is a source diagnostic; no upstream full integration suite or production mutation ran.
LibraryRootView.post grants the creator admin permissions and then constructs the response serializer without request context. The serializer permission method returns false when context has no request. The library detail GET does supply request context.
Reproduction: create a v2 library as an author allowed to create libraries; inspect can_edit_library in the POST response, then fetch the detail as the same author. The create response follows the no-request/false branch despite the just-granted permissions; the context-aware detail can report the actual permission.
Expected: the successful create response reports the creator's actual edit permission, consistently with the detail response. Pass the request through get_serializer or explicit serializer context. Test creator, reader and denied caller without weakening authorization.
This report's current-source claim is the missing context and deterministic serializer false branch. No fresh end-to-end library creation ran for this filing. Duplicate checks: current issue/PR searches for LibraryRootView and can_edit_library context returned no matching report.
- 主要语言
- Python
- 星标
- 8.2k
- 派生
- 4.4k
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 40
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openedx/openedx-platform 的其他 Issue
-
Discussion API: missing thread returns 500 (ForumV2RequestError not mapped to ThreadNotFoundError)可能重新可做 @mbhavu2007-lang 于 16 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
openedx/openedx-platform#39225 · 1 条评论 ·
维护者通常 1 天内回复
-
v3 notification preferences: PUT with email_cadence but no notification_channel raises KeyError (500)可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 66/100
openedx/openedx-platform#39221 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
openedx/openedx-platform#39084 ·
维护者通常 1 天内回复
-
难度 2/5 1 小时以内 新手友好度 82/100
openedx/openedx-platform#38792 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
openedx/openedx-platform#38544 ·
维护者通常 1 天内回复
查看 openedx/openedx-platform 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
难度 2/5 1-3 小时 新手友好度 76/100
btclib-org/btclib-wallet#1045 ·
维护者通常 1 天内回复
-
area-templates triage:bot-seen triage:needs-human
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/aspire#22356 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
[Train] An elastic ScalingConfig(num_workers=(0, 0)) is accepted and the run waits forever可能已有人在做 @wguo7 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
ray-project/ray#68217 ·
维护者通常 2 天内回复