Skip to content

feat: add Waffle flag to control start date access for masquerading users#37547

Merged
feanil merged 1 commit intoopenedx:masterfrom
open-craft:agrendalath/start-date-masquerade
Nov 20, 2025
Merged

feat: add Waffle flag to control start date access for masquerading users#37547
feanil merged 1 commit intoopenedx:masterfrom
open-craft:agrendalath/start-date-masquerade

Conversation

@Agrendalath
Copy link
Copy Markdown
Member

@Agrendalath Agrendalath commented Oct 24, 2025

Description

Staff members masquerading as students currently bypass start date restrictions, which means they don't experience the course the same way students do. This makes it difficult to accurately preview and test how content will appear to students based on section and subsection start dates.

This PR adds the course_experience.enforce_masquerade_start_dates Waffle flag to allow enforcing start date restrictions for masquerading users. When enabled, staff viewing the course as a masqueraded student will see the same start date restrictions as actual students, providing a more accurate preview experience.
The flag is disabled by default, preserving the existing bypass behavior to avoid disrupting current workflows.

Testing instructions

  1. Create a course with a section in the future.
  2. Enroll a regular (non-staff) user in the course.
  3. As staff, view the course outline as the user from the previous point.
  4. Ensure that you can see the section that's scheduled for the future.
  5. Add the course_experience.enforce_masquerade_start_dates Waffle flag (/admin/waffle/flag/).
  6. Reload the course outline page and ensure you no longer see the section scheduled for the future.

Deadline

None.

Other information

When enabled, masquerading into a course with a future start date will lock staff out of that course in the current session. Staff will need to log out and back in to regain normal access (or just wait until the course starts). I did not modify this behavior to avoid making too invasive changes to the code that handles permissions (high risk).

Private-ref: BB-9603

@Agrendalath Agrendalath self-assigned this Oct 24, 2025
@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 Oct 24, 2025
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @Agrendalath!

This repository is currently maintained by @openedx/wg-maintenance-edx-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.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Oct 24, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready to Merge in Contributions Oct 27, 2025
@mphilbrick211 mphilbrick211 moved this from Ready to Merge to Ready for Review in Contributions Oct 27, 2025
@mphilbrick211 mphilbrick211 added the needs reviewer assigned PR needs to be (re-)assigned a new reviewer label Oct 27, 2025
…sers

This introduces the `ENFORCE_MASQUERADE_START_DATES` flag.
When the flag is disabled (default), masquerading users bypass start dates.
When the flag is enabled, masquerading users see the same start date
restrictions as regular students.
@Agrendalath Agrendalath force-pushed the agrendalath/start-date-masquerade branch from 116f4fd to 890b826 Compare October 28, 2025 12:46
@feanil feanil merged commit 02c1530 into openedx:master Nov 20, 2025
49 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Contributions Nov 20, 2025
@openedx-webhooks openedx-webhooks removed the needs reviewer assigned PR needs to be (re-)assigned a new reviewer label Nov 20, 2025
@Agrendalath Agrendalath deleted the agrendalath/start-date-masquerade branch November 20, 2025 17:32
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

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants