Skip to content

feat(authz): add group configuration permission validation - #3207

Merged
bradenmacdonald merged 6 commits into
openedx:masterfrom
eduNEXT:dcoa/group-config-view
Sep 5, 2026
Merged

feat(authz): add group configuration permission validation#3207
bradenmacdonald merged 6 commits into
openedx:masterfrom
eduNEXT:dcoa/group-config-view

Conversation

@dcoa

@dcoa dcoa commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the courses.view_group_configurations permission and moves the Group Configurations page onto a view/manage split, so that a user can be granted read access to the page without being granted the ability to change anything on it, that is the case of Course Auditor.

This adds the missing view half of the pair, and splits the two responsibilities:

  • view_group_configurations — controls whether the page and its navigation links are reachable at all.
  • manage_group_configurations — controls whether the page's action controls are rendered.

Per the AuthZ convention that a manage_* permission implicitly grants the matching view_*, users who can manage group configurations are unaffected; the page looks and behaves exactly as it does today.

What changed

Access sections now gate on view instead of manage

Entry point File
Studio header → Settings → Group Configurations src/header/hooks.tsx
Help sidebar → "Other course settings" src/generic/help-sidebar/HelpSidebar.tsx
Course outline info sidebar → Settings src/course-outline/outline-sidebar/info-sidebar/CourseInfoSidebar.tsx
Group Configurations page (PermissionDeniedAlert gate) src/group-configurations/index.tsx

Read-only page for view-without-manage users

readOnly={!canManageGroupConfigurations} is passed from the page down to the Content Groups and Experiment Configurations sections. When set:

  • The empty-state copy changes from "You have not created any content groups yet." to "No group configurations have been added to this course yet.", and the "Add your first content group" / "Add your first group configuration" button is not rendered.
  • The "Add new content group" and "Add new group configuration" buttons are not rendered.
  • The per-card edit and delete icon buttons are not rendered.

Everything informational is kept: cards still expand, usage lists still link to the units that use each group, and the "In the {course outline}, use this group to control access to a component." guidance keeps its link to the course outline.

Supporting information

Important

Depends on openedx/openedx-platform#39010

Closes openedx/openedx-authz#323
Design link

Testing instructions

Requires the authz.enable_course_authoring waffle flag; with it off, permissions all resolve to true and none of this is exercised.

1. Flag on, user with course_editor role

  1. Enable authz.enable_course_authoring.
  2. Assign course_editor through http://local.openedx.io:8000/api/authz/v1/roles/users/
  3. Sign in as a the course editor on the course.
  4. Confirm the Group Configurations link appears in the header Settings menu, the help sidebar, and the course outline info sidebar.
  5. Confirm the page renders exactly as before: all add/edit/delete controls present and working.

2. Flag on, user with view_group_configurations only

  1. Assign course_auditor through http://local.openedx.io:8000/api/authz/v1/roles/users/, and navigate to the course scope.
  2. Confirm the Group Configurations link still appears in all three navigation entry points.
  3. Open the page and confirm:
    • It renders (no PermissionDeniedAlert).
    • No "Add new content group" or "Add new group configuration" button.
    • No edit or delete icon on any card.
    • Clicking a card title still expands it, and the usage links still navigate to the units.
    • For a group not used anywhere, the "In the Course outline, use this group…" text and its link are still shown.
  4. On a course with no content groups and no experiment configurations, confirm the placeholder reads "No group configurations have been added to this course yet." with no button beneath it.
image image

Other information

This branch also carries three refactors of the files it touched, in separate commits, to bring them in line with the repo's Best Practices Checklist. Both are behaviour-preserving.

5d2dfe7 — TypeScript conversion.
05392335 — declarative i18n.
090fd39 - test refactor

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 Aug 26, 2026
@openedx-webhooks

openedx-webhooks commented Aug 26, 2026

Copy link
Copy Markdown

Thanks for the pull request, @dcoa!

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

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.61905% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.97%. Comparing base (f5041a7) to head (9c58ed0).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ations/experiment-configurations-section/index.tsx 87.50% 1 Missing ⚠️
...nfigurations/group-configuration-sidebar/utils.tsx 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3207      +/-   ##
==========================================
+ Coverage   95.93%   95.97%   +0.04%     
==========================================
  Files        1397     1397              
  Lines       33622    33692      +70     
  Branches     7701     7998     +297     
==========================================
+ Hits        32256    32337      +81     
+ Misses       1323     1299      -24     
- Partials       43       56      +13     

☔ View full report in Codecov by Harness.
📢 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.

@dcoa dcoa changed the title feat(authz): add group permission page validation feat(authz): add group configuration permission page validation Aug 26, 2026
@dcoa dcoa changed the title feat(authz): add group configuration permission page validation feat(authz): add group configuration permission validation Aug 26, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Aug 26, 2026
BryanttV added a commit to eduNEXT/frontend-app-authoring that referenced this pull request Aug 27, 2026
@dcoa dcoa self-assigned this Sep 1, 2026
@dcoa
dcoa marked this pull request as ready for review September 1, 2026 04:42
@dcoa
dcoa requested a review from bradenmacdonald September 1, 2026 04:42
@dcoa
dcoa force-pushed the dcoa/group-config-view branch from 090fd39 to 3720988 Compare September 2, 2026 22:07

@bradenmacdonald bradenmacdonald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for all the cleanups, improvements, and nice comments on the code! ❤️💯

I noticed even in read only mode, it has this help text in the sidebar. Is that OK?

Image

@dcoa

dcoa commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

I noticed even in read only mode, it has this help text in the sidebar. Is that OK?

There is not indication in the Figma about the sidebar, but i will double check and let you know

@maguilarUXUI

Copy link
Copy Markdown

Thanks, @bradenmacdonald! You're right, in the read-only view I don't think this information should appear. Although I didn't account for that detail in the design, @dcoa do you think there's time to fix it before merging?

@dcoa

dcoa commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @maguilarUXUI for the confirmation.

@bradenmacdonald I pushed a commit that changes the paragraph for read-only users.

@bradenmacdonald
bradenmacdonald merged commit c12c9a5 into openedx:master Sep 5, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting on Author to Done in Contributions Sep 5, 2026
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: Done

Development

Successfully merging this pull request may close these issues.

Task - implement course team & groups

5 participants