Skip to content

feat: Add validation for Advanced Settings permissions using openedx-authz#2869

Merged
diana-villalvazo-wgu merged 6 commits intoopenedx:masterfrom
WGU-Open-edX:rod/authz-advanced-settings
Feb 19, 2026
Merged

feat: Add validation for Advanced Settings permissions using openedx-authz#2869
diana-villalvazo-wgu merged 6 commits intoopenedx:masterfrom
WGU-Open-edX:rod/authz-advanced-settings

Conversation

@rodmgwgu
Copy link
Contributor

@rodmgwgu rodmgwgu commented Feb 10, 2026

Description

Resolves: #2831

As part of the AuthZ for course authoring project Milestone 0, we are implementing more granular permission checks, starting with the Advanced Settings section.

This PR adds permission checks on:

  1. The "Settings" dropdown menu on the header when authoring a course (Show or hide Advanced Settings link)
  2. On the "Help Sidebar" shown on some setting pages under course authoring (Show or hide Advanced Settings link)
  3. On the Advanced Settings page (Show a Permission Denied Alert if not authorized)

The permission checks are only done if the "authz.enable_course_authoring" feature flag is enabled, otherwise the existing behavior is maintained.

Supporting information

Testing instructions

First, choose or create a course to test, in this example we will be using "course-v1:OpenedX+DemoX+DemoCourse"

With the flag disabled

When the flag is disabled, current behavior is maintained:

  1. Make sure the course flag is disabled (or doesn't exist) in the Django admin under /admin/waffle_utils/waffleflagcourseoverridemodel/
Screenshot 2026-02-10 at 3 54 08 p m
  1. Go to Studio and select the course, the "Advanced Settings" link should appear under the "Settings" menu in the header:
Screenshot 2026-02-10 at 3 54 39 p m
  1. Go to "Grading", you should see the Advanced Settings link in the Help Sidebar:
Screenshot 2026-02-10 at 3 54 49 p m
  1. Go to "Advanced Settings", the page should load as normal:
Screenshot 2026-02-10 at 3 54 28 p m

With the flag enabled and with a user with no "courses.manage_advanced_settings" permission:

  1. Make sure the course flag is enabled in the Django admin under /admin/waffle_utils/waffleflagcourseoverridemodel/
Screenshot 2026-02-10 at 3 53 59 p m
  1. Go to Studio and select the course, the "Advanced Settings" link should NOT appear under the "Settings" menu in the header:
Screenshot 2026-02-10 at 3 52 45 p m
  1. Go to "Grading", you should NOT see the Advanced Settings link in the Help Sidebar:
Screenshot 2026-02-10 at 3 52 34 p m
  1. Try to go to "Advanced Settings" directly by using a url like http://apps.local.openedx.io:2001/authoring/course/course-v1:OpenedX+DemoX+DemoCourse/settings/advanced - You should see a message telling you don't have permission:
Screenshot 2026-02-10 at 3 53 23 p m

Other information

Depends on:

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Avoid propTypes and defaultProps in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Avoid using ../ in import paths. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

@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 10, 2026
@openedx-webhooks
Copy link

openedx-webhooks commented Feb 10, 2026

Thanks for the pull request, @rodmgwgu!

This repository is currently maintained by @bradenmacdonald.

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.

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.22%. Comparing base (7173b71) to head (c48440e).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2869      +/-   ##
==========================================
+ Coverage   95.21%   95.22%   +0.01%     
==========================================
  Files        1318     1328      +10     
  Lines       30018    30535     +517     
  Branches     6543     6917     +374     
==========================================
+ Hits        28582    29078     +496     
- Misses       1379     1388       +9     
- Partials       57       69      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

showSaveSettingsPrompt(true);
};

if (isAuthzEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be simplified with something like:

const hasPermissionToManage = isAuthzEnabled 
  && !isLoadingUserPermissions 
  && !userPermissions?.canManageAdvancedSettings;

if (hasPermissionToManage) {
  return <PermissionDeniedAlert />;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to make it clear that that code snipped will only run when isAuthzEnabled. But I guess I can do that with a comment, I'll change that, thanks

Copy link
Contributor

@dwong2708 dwong2708 left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of optional suggestions.

Copy link
Contributor

@jacobo-dominguez-wgu jacobo-dominguez-wgu left a comment

Choose a reason for hiding this comment

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

LGTM!

@dwong2708
Copy link
Contributor

Just a small comment: I noticed this PR isn’t linked to the issue. I’m guessing it’s because it says “Related issue: link…”. You might want to change it to “Resolves: link…” instead.

@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Feb 18, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Feb 18, 2026
Copy link
Contributor

@diana-villalvazo-wgu diana-villalvazo-wgu left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@diana-villalvazo-wgu diana-villalvazo-wgu merged commit 5ccf39d into openedx:master Feb 19, 2026
9 checks passed
@github-project-automation github-project-automation bot moved this from In Eng Review to Done in Contributions Feb 19, 2026
@diana-villalvazo-wgu diana-villalvazo-wgu deleted the rod/authz-advanced-settings branch February 19, 2026 20:39
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). mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Task - RBAC AuthZ - Show or hide Advanced settings given permission for PoC

6 participants