Skip to content

feat(authz): build the role assignation wizard from the catalog - #267

Merged
dcoa merged 2 commits into
dcoa/catalog-4-user-permissionsfrom
dcoa/catalog-5-assign-wizard
Nov 11, 2026
Merged

dcoa merged 2 commits into
dcoa/catalog-4-user-permissionsfrom
dcoa/catalog-5-assign-wizard

Conversation

@dcoa

@dcoa dcoa commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Build the role assignment wizard from the AuthZ catalog, replacing its hardcoded role metadata.

  • Display catalog role names and descriptions in catalog order.
  • Preserve manage-team permission checks and course-authoring flag restrictions.
  • Carry the selected role’s scope type into scope filtering and permission checks.
  • Use backend scope-type identifiers (course-v1 and lib) for scope queries and wildcard helpers.
  • Present all roles as one required radio group, with labelled Courses and Libraries sections.
  • Announce catalog loading and display an error alert when loading fails.
  • Remove disabled-role placeholders.

Affects role selection, scope discovery, and role assignment. Depends on the preceding catalog changes, including #266.

Evidence

Before: The wizard offers frontend-maintained roles and looks up their scope types in hardcoded metadata.

After: Available roles come from the catalog, and the selected role determines which scope type can receive the assignment.

image At the moment this screenshot is taken the Course Editor and Auditor roles are hidden therefore not returned by the API. image

Tests cover permission-based role visibility, catalog ordering, loading and error states, single-selection semantics, scope filtering, wildcard scope helpers, and assignment submission.

Test instructions

npm test -- --watch=false --runInBand \
  src/authz-module/role-assignation-wizard \
  src/authz-module/constants.test.ts

With the catalog backend available:

  1. Open Assign Role and verify the available role names and descriptions against the catalog.
  2. Use Tab and arrow keys to select a role across the Courses and Libraries sections. Confirm only one role remains selected.
  3. Enter a valid user and continue. Verify that only scopes of the selected role’s scope type appear.
  4. Select a scope and save. Confirm the request contains the selected role ID, users, and scope keys.
  5. Verify library-only management access and disabled course authoring restrict the available roles appropriately.
  6. Simulate a slow or failed catalog request and verify the loading status or error alert.

Additional information

Partially closes openedx/openedx-authz#535

AI disclosure

Assisted by Claude

@dcoa
dcoa added this pull request to stack #265 October 15, 2026 03:25
@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 15, 2026
@openedx-webhooks

openedx-webhooks commented Oct 15, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @dcoa!

This repository is currently maintained by @openedx/committers-frontend.

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 Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.90%. Comparing base (a490953) to head (bf39b88).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           dcoa/catalog-4-user-permissions     #267   +/-   ##
================================================================
  Coverage                            98.90%   98.90%           
================================================================
  Files                                   81       81           
  Lines                                 1465     1465           
  Branches                               477      451   -26     
================================================================
  Hits                                  1449     1449           
  Misses                                  16       16           

☔ 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 force-pushed the dcoa/catalog-5-assign-wizard branch from 281701c to 5d3a679 Compare October 15, 2026 07:06
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Oct 22, 2026
@dcoa
dcoa force-pushed the dcoa/catalog-5-assign-wizard branch 2 times, most recently from 372a1f9 to 1f7b084 Compare October 29, 2026 06:08
@dcoa
dcoa marked this pull request as ready for review October 29, 2026 06:24
@dcoa
dcoa force-pushed the dcoa/catalog-5-assign-wizard branch from 1f7b084 to 00be97f Compare October 29, 2026 09:00
@mphilbrick211 mphilbrick211 moved this from Waiting on Author to Ready for Review in Contributions Nov 4, 2026

@jacobo-dominguez-wgu jacobo-dominguez-wgu 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.

Tested locally and works as described!

@dcoa
dcoa force-pushed the dcoa/catalog-5-assign-wizard branch from 00be97f to 1fbd586 Compare November 5, 2026 02:27

@bra-i-am bra-i-am 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.

Working great!! Just need to solve conflicts

Image

@dcoa
dcoa force-pushed the dcoa/catalog-5-assign-wizard branch 2 times, most recently from 7621b84 to a5aa50a Compare November 9, 2026 05:40
dcoa and others added 2 commits November 10, 2026 13:56
The wizard offers the catalog roles of the selected scope type and shows their permissions from the catalog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only one role is assigned, but each scope type rendered its own required
radio group, so assistive technology announced several required choices
and a selection in one group silently cleared another.

Render one required radio group named by the Roles heading, with each
scope type as a named group inside it. All the radios share a name, so
arrow keys move through every role and a single selection is native.
Roles offered in several scope types aren't supported yet, so the role
identifies its scope type.

Tests find the scope type groups by role and name, and drop the cases
the single group makes redundant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dcoa
dcoa force-pushed the dcoa/catalog-5-assign-wizard branch from a5aa50a to bf39b88 Compare November 10, 2026 02:56
@dcoa
dcoa merged commit efb6c76 into master Nov 11, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Contributions Nov 11, 2026
@dcoa
dcoa deleted the dcoa/catalog-5-assign-wizard branch November 11, 2026 22:12
@openedx-semantic-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-alpha.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

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 released on @latest

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Migrate Admin Console to the new scope_type values (course-v1/lib)

5 participants