Gate XBlock component card action menu on RBAC edit_course_content permission - #39013
Gate XBlock component card action menu on RBAC edit_course_content permission#39013jacobo-dominguez-wgu wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @jacobo-dominguez-wgu! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
bc4e3c5 to
e258346
Compare
e2806ad to
b05b1f4
Compare
b05b1f4 to
b49bbf2
Compare
Description
This PR gates the XBlock component card action menu (
header-actionsdiv) in the Studio course-unit page on the RBACcourses.edit_course_contentpermission, but only when theauthz.enable_course_authoringwaffle flag is on for the course.Two new boolean flags,
is_authz_authoring_enabledandauthz_can_edit_course_content, are computed once per preview request inxblock_view_handlerand threaded through_studio_wrap_xblockto thestudio_xblock_wrapper.htmltemplate. The template wraps the entireheader-actionsdiv with:% if not is_authz_authoring_enabled or authz_can_edit_course_content:This means:
is_authz_authoring_enabled=False, condition is alwaysTrue, the menu renders exactly as before — zero behaviour change.True, menu renders normally.authz_can_edit_course_content=False, menu is suppressed.Affected roles:
Course Authors / Course Staff in courses where the authz flag is enabled. Roles with
courses.edit_course_content(COURSE_EDITOR, COURSE_STAFF, COURSE_ADMIN) continue to see the full menu. Roles without it (COURSE_AUDITOR, etc.) no longer see the menu.No database migrations. No new feature flags — reuses the existing
authz.enable_course_authoringwaffle flag.Supporting information
Continuation of openedx/frontend-app-authoring#3196 (course outline home page) and openedx/frontend-app-authoring#3200 (course subsections/units page).
Partially closes openedx/openedx-authz#383
Depends on openedx/openedx-authz#384.
Figma design
Testing instructions
Requirements
Enable the
authz.enable_course_authoringwaffle flag.You can set course_auditor or course_editor role to a user using the API
<lms_url>/api-docs/#/authz/authz_v1_roles_users_updatePayload example:
COURSE_AUDITORrole (noedit_course_content).COURSE_EDITORorCOURSE_STAFF.authz.enable_course_authoringflag for the course and repeatstep 1 — the menu must be visible (flag-off fallback).
Other information
View for

COURSE_EDITOR,COURSE_STAFF,COURSE_ADMIN,superuserwithauthz.enable_course_authoringwaffle flag on:View for

COURSE_AUDITORwithauthz.enable_course_authoringwaffle flag on:AI usage notice
Used Claude Opus 4.8 through kiro to assist on the modification and creation of unit tests.
Warning
Needs this pr merged to be fully functional, will be in draft status until the 403 problem is fixed openedx/openedx-authz#384