Skip to content

feat(authz): build the roles permission matrix from the catalog - #264

Merged
dcoa merged 3 commits into
dcoa/catalog-2-roles-filterfrom
dcoa/catalog-3-permissions-matrix
Nov 11, 2026
Merged

dcoa merged 3 commits into
dcoa/catalog-2-roles-filterfrom
dcoa/catalog-3-permissions-matrix

Conversation

@dcoa

@dcoa dcoa commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Build the Roles and Permissions matrix from the AuthZ catalog, replacing the hardcoded course and library definitions.

  • Show only the scope types the user can view, with courses selected first when available.
  • Use catalog names, descriptions, and icons for roles, permissions, and categories.
  • Order roles from most to fewest permissions.
  • Add category popovers describing their permissions.
  • Handle catalog loading and errors, and group uncategorized permissions under Other.
  • Remove disabled-role placeholders; the matrix displays the roles returned by the catalog.
  • As an improvement for category grouping and accessibility each category is a tbody. It also improve the testing to ensure each permission is displayed in the right category.

Evidence

Before: The matrix uses frontend-maintained role and permission definitions that must be synchronized with the backend.

After: The matrix reflects the backend catalog, including role grants, category grouping, and display metadata.

image At the moment this screenshot is taken the backend hides Course Editor and Course Auditor. image

Tests cover scope selection, role ordering, loading and error states, category descriptions, grant indicators, and uncategorized permissions.

Test instructions

npm test -- --watch=false --runInBand \
  src/authz-module/roles-permissions \
  src/authz-module/components/PermissionTable.test.tsx

With the catalog backend available:

  1. Open Roles and Permissions with access to both course and library teams.
  2. Switch between scope types and verify names, categories, and grant indicators against the catalog response.
  3. Hover over category information icons to verify descriptions.
  4. Repeat with library-only access and confirm only the Libraries option appears.
  5. Simulate a slow or failed catalog request and verify the loading indicator or error message.

Affects the Roles and Permissions view and its dependency on catalog availability. Requires the catalog infrastructure introduced in #262.

AI disclosure

Code assisted by Claude

@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.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Oct 15, 2026
@dcoa
dcoa changed the base branch from master to dcoa/catalog-2-roles-filter October 15, 2026 03:18
@dcoa
dcoa added this pull request to stack #265 October 15, 2026 03:18
@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.78%. Comparing base (47f94f1) to head (ee35f5f).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           dcoa/catalog-2-roles-filter     #264      +/-   ##
===============================================================
+ Coverage                        98.62%   98.78%   +0.15%     
===============================================================
  Files                               83       84       +1     
  Lines                             1458     1483      +25     
  Branches                           488      485       -3     
===============================================================
+ Hits                              1438     1465      +27     
+ Misses                              19       18       -1     
+ Partials                             1        0       -1     

☔ 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-3-permissions-matrix branch from e69f4d7 to e84f7d3 Compare October 15, 2026 07:06
@dcoa dcoa changed the title feat(authz): build the roles filter from the catalog feat(authz): build the roles permission matrix from the catalog Oct 20, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Oct 22, 2026
@dcoa
dcoa force-pushed the dcoa/catalog-3-permissions-matrix branch from e84f7d3 to ee7b875 Compare October 28, 2026 07:48
@dcoa
dcoa force-pushed the dcoa/catalog-3-permissions-matrix branch 2 times, most recently from 8b76885 to 41ee384 Compare October 28, 2026 12:24
@dcoa
dcoa marked this pull request as ready for review October 29, 2026 02:20
@dcoa
dcoa force-pushed the dcoa/catalog-3-permissions-matrix branch from 41ee384 to edda083 Compare October 29, 2026 09:00
@mphilbrick211 mphilbrick211 moved this from Waiting on Author to Ready for Review in Contributions Nov 4, 2026
</Popover>
)}
>
<Icon className="d-inline-block text-gray-300 ml-2 my-auto" src={Info} size="sm" />

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.

nit: Not introduced by this pr but keyboard users can't open the category popover. The trigger is a Paragon Icon, which renders a span that can't take focus..The old ResourceTooltip had the same problem, but this is a new component in a PR that claims an accessibility improvement. Feel free to address it on this pr or create a new ticket for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied e34fc45 it also darken the icon button to improve contrast

'authz.tabs.permissionsRoles.category.other': {
id: 'authz.tabs.permissionsRoles.category.other',
defaultMessage: 'Other',
description: 'Libraries AuthZ name of the category that groups the permissions without a category in the roles table',

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.

Suggested change
description: 'Libraries AuthZ name of the category that groups the permissions without a category in the roles table',
description: 'AuthZ name of the category that groups the permissions without a category in the roles table',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

applied c4ee549

@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.

this looks good!!

I only have one UI suggestion: showing a single “Courses” or “Libraries” button looks like kinda weird. Could the selector be shown only when more than one scope type is available?

Scope selector showing only one available option

@jacobo-dominguez-wgu

jacobo-dominguez-wgu commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

this looks good!!

I only have one UI suggestion: showing a single “Courses” or “Libraries” button looks like kinda weird. Could the selector be shown only when more than one scope type is available?

Scope selector showing only one available option

I like this suggestion but according to the plan this screen will change soon due to the custom roles openedx/openedx-authz#568, so I wont invest more effort on this.

@bra-i-am
bra-i-am self-requested a review November 6, 2026 17:11
@dcoa
dcoa force-pushed the dcoa/catalog-3-permissions-matrix branch 2 times, most recently from 8520486 to fc145c0 Compare November 9, 2026 05:40
dcoa and others added 3 commits November 10, 2026 13:56
@dcoa
dcoa force-pushed the dcoa/catalog-3-permissions-matrix branch from fc145c0 to ee35f5f Compare November 10, 2026 02:56
@dcoa
dcoa merged commit 9d0e057 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-3-permissions-matrix 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.

5 participants