Fix XBlock studio handler silently dropping Course Editor writes
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- authorization, backend-api-design
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 0
- Forks
- 10
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 21
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
-
willow
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openedx/openedx-authz#597 ·
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
-
willow
Difficulty 4/5 1-2 days Newbie friendliness 48/100
openedx/openedx-authz#600 ·
Maintainers usually reply within 1 day
-
willow
Difficulty 3/5 1-2 days Newbie friendliness 74/100
openedx/openedx-authz#599 ·
Maintainers usually reply within 1 day
-
willow
Difficulty 4/5 3-5 days Newbie friendliness 55/100
openedx/openedx-authz#596 ·
Maintainers usually reply within 1 day
All issues in openedx/openedx-authz
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
huggingface/deep-rl-class#723 ·
-
[tool] bug: Qwen3 XML tool parser raises on `...` argument values (Ellipsis is not JSON serializable)Possibly taken @super-yuki claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
verl-project/verl#8559 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
TencentCloud/octop-harness#228 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
google/osv-scalibr#2585 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
NousResearch/hermes-agent#149323 ·
Maintainers usually reply within 1 day