You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Require publish permission when a save request publishes content #600
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 as metadata.
Observe that the block is published.
Acceptance Criteria
A request that publishes (make_public, or republish on a non-direct-only block with a published version) requires PUBLISH_COURSE_CONTENT.
A request with content fields requires EDIT_COURSE_CONTENT; a request with both requires both.
An Editor sending content plus make_public no longer publishes.
Pure edits and pure publishes by correctly-privileged users keep working.
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.
Draft fix is up in openedx/openedx-platform#39423. It follows the acceptance criteria: a save request that publishes (make_public, or republish on a non direct-only block that already has a published version) now requires publish_course_content in addition to edit_course_content. On a devstack, an Editor sending content plus make_public now gets a 403 and nothing is published (on master the unit was published).
It's a draft because of the product question in the issue, and I think we need an answer before it merges.
What happens when an Editor changes a published unit through republish?
The authoring MFE sends republish plus metadata from the unit Configure modal (name, visibility, group access) and from component "Manage access". It hides the Publish buttons when the user can't publish, but these dialogs stay available to Editors. Today the change goes live right away, which is the bug. The options:
Deny it (403). This is what the PR does now. It's the simplest and strictest option, but an Editor using those dialogs on a published unit gets an error, so the MFE would need to hide them or explain why the save failed.
Save as a draft. Save the change but skip the publish for users without publish permission (downgrade republish to no publish). The unit then shows unpublished changes, and someone with publish permission publishes it. Editors keep a working UI, but the API silently does less than the request asked for.
I'd lean towards 2, because it matches the "Editor edits, Staff publishes" split and doesn't break the MFE for Editors. Happy to switch the PR to it if we agree.
Also, as the issue asks, a second opinion on the API-level validation would be welcome. The fix decides in the permission check whether the save will publish, by mirroring the publish logic at the end of _save_xblock (_save_publishes). If someone sees a publish path that bypasses that check, please point it out.
Activity
efortish commentedon Nov 23, 2026
Draft fix is up in openedx/openedx-platform#39423. It follows the acceptance criteria: a save request that publishes (
make_public, orrepublishon a non direct-only block that already has a published version) now requirespublish_course_contentin addition toedit_course_content. On a devstack, an Editor sending content plusmake_publicnow gets a 403 and nothing is published (on master the unit was published).It's a draft because of the product question in the issue, and I think we need an answer before it merges.
What happens when an Editor changes a published unit through
republish?The authoring MFE sends
republishplus metadata from the unit Configure modal (name, visibility, group access) and from component "Manage access". It hides the Publish buttons when the user can't publish, but these dialogs stay available to Editors. Today the change goes live right away, which is the bug. The options:republishto no publish). The unit then shows unpublished changes, and someone with publish permission publishes it. Editors keep a working UI, but the API silently does less than the request asked for.I'd lean towards 2, because it matches the "Editor edits, Staff publishes" split and doesn't break the MFE for Editors. Happy to switch the PR to it if we agree.
Also, as the issue asks, a second opinion on the API-level validation would be welcome. The fix decides in the permission check whether the save will publish, by mirroring the publish logic at the end of
_save_xblock(_save_publishes). If someone sees a publish path that bypasses that check, please point it out.@BryanttV