Skip to content

feat: Add Waffle flag for AuthZ for Course Authoring#37985

Open
rodmgwgu wants to merge 3 commits intoopenedx:masterfrom
WGU-Open-edX:rod/authz_course_authoring_flag
Open

feat: Add Waffle flag for AuthZ for Course Authoring#37985
rodmgwgu wants to merge 3 commits intoopenedx:masterfrom
WGU-Open-edX:rod/authz_course_authoring_flag

Conversation

@rodmgwgu
Copy link
Contributor

@rodmgwgu rodmgwgu commented Feb 5, 2026

Description

This PR adds a feature flag that will be used to toggle the new authorization implementation (openedx-authz) over the Course Authoring experience.

This is a temporary flag that will be deprecated after Willow as specified in this ADR: https://github.com/openedx/openedx-authz/blob/main/docs/decisions/0010-course-authoring-flag.rst

Supporting information

This is part of the Phase 2 of the RBAC AuthZ project, related ticket: #37927

The following ADR specifies the rationales and decisions related to this change: https://github.com/openedx/openedx-authz/blob/main/docs/decisions/0010-course-authoring-flag.rst

Testing instructions

How to use

# Import the flag
from openedx.core.toggles import AUTHZ_COURSE_AUTHORING_FLAG

# Check if it's enabled, passing the course_key
is_enabled = AUTHZ_COURSE_AUTHORING_FLAG.is_enabled(course_key=course_key)

To enable it globally:

  1. In the Django Admin, go to Home > django-waffle > Flags (/admin/waffle/flag/)
  2. Click on ADD FLAG
  3. Set the Name to "authz.enable_course_authoring"
  4. Set Everyone: "Yes"
  5. Click "Save"

To enable for a specific course (or override if it was previously enabled globally):

  1. In the Django Admin, go to Home > Waffle_Utils > Waffle flag course overrides (/admin/waffle_utils/waffleflagcourseoverridemodel/)
  2. Click on "ADD WAFFLE FLAG COURSE OVERRIDE"
  3. Set Waffle flag to "authz.enable_course_authoring"
  4. Set Course id to the desired course key
  5. Set Override choice to the desired effect
  6. Check the "Enabled" box
  7. Click "Save"

To enable for an org (or override if it was previously enabled globally):

  1. In the Django Admin, go to Home > Waffle_Utils > Add Waffle flag org override (/admin/waffle_utils/waffleflagorgoverridemodel/)
  2. Click on "ADD WAFFLE FLAG ORG OVERRIDE"
  3. Set Waffle flag to "authz.enable_course_authoring"
  4. Set Course id to the desired Org name
  5. Set Override choice to the desired effect
  6. Check the "Enabled" box
  7. Click "Save"

How will the flag behave:

  • Course level flags take precedence over Org level flags.
  • Both override the global Flag.
  • Course and Org level flags need to be "Enabled" for the override to apply

Caveats:

Waffle Flags allow configuring the flag to be enabled to specific users or groups of users. This won't be supported by the openedx-authz implementation because it would cause validation inconsistencies. A Waffle Switch would have been a better fit, but there are no existing ways to override Waffle Switchs for specific courses or orgs.

Deadline

Verawood release

Other information

This flag will be used in follow-up changes related to the RBAC AuthZ Phase 2 project.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Feb 5, 2026
@openedx-webhooks
Copy link

Thanks for the pull request, @rodmgwgu!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link
Contributor

@wgu-taylor-payne wgu-taylor-payne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just had one question come to mind.

# .. toggle_creation_date: 2026-02-05
# .. toggle_target_removal_date: 2027-06-09
# .. toggle_tickets: https://github.com/openedx/openedx-platform/issues/37927
AUTHZ_COURSE_AUTHORING_FLAG = CourseWaffleFlag('authz.enable_course_authoring', __name__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this flag need to be available to the LMS (i.e. Instructor Dashboard)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, the only flow that I know for sure would technically be on the LMS is the course team management that is also available on the Instructor Dashboard.

Do you think this flag should live elsewhere because of that? I'm not sure where it would be a good place to put it, any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if we do anticipate using it in the course team management, I think we would want it in a common location such as openedx/core/toggles.py. @bmtcril Any input on where it makes sense to define the flag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that it's fairly tightly bound to CourseOverview I think it would be fair to put it in openedx/core/djangoapps/course_overviews where both sides can get at it. openedx/core/toggles.py would also make sense to me. I'll ask around at our standup for opinions, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like openedx/core/toggles.py is the consensus!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll do the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

4 participants