Skip to content

refactor(authz): remove the hardcoded catalog - #269

Merged
dcoa merged 3 commits into
dcoa/catalog-6-team-tablesfrom
dcoa/catalog-7-remove-hardcoded
Nov 11, 2026
Merged

dcoa merged 3 commits into
dcoa/catalog-6-team-tablesfrom
dcoa/catalog-7-remove-hardcoded

Conversation

@dcoa

@dcoa dcoa commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Remove the hardcoded course and library catalog now that its consumers use backend catalog data.

  • Delete the hardcoded role, permission, and category definitions and their obsolete types.
  • Replace CONTENT_*_PERMISSIONS with shared VIEW_TEAM_ACTIONS and MANAGE_TEAM_ACTIONS, keyed by scope type.
  • Move permission-validation request lists into the shared AuthZ constants.
  • Replace CONTEXT_TYPES and getScopeContextType with SCOPE_TYPES and getScopeType.
  • Update scope labels, permission lookups, action controls, and deletion messages to use course-v1 and lib.

Authorization checks continue through permission validation; the catalog provides descriptive metadata.

Touches shared permission constants, scope classification, and their consumers across the wizard and tables. Depends on the preceding catalog migrations, including #268.

Evidence

Before: Catalog-backed screens coexist with unused hardcoded definitions, legacy types, and separate context-type identifiers.

After: Consumers use catalog types and a shared scope-type vocabulary. Scope classification remains centralized in getScopeType.

Test instructions

npm run types
npm run lint
npm test -- --watch=false --runInBand

Manually verify:

  1. Course and library roles and permissions render in the matrix and assignment breakdowns.
  2. Assign Role offers the appropriate roles and scopes for the user’s permissions.
  3. Course-authoring restrictions still control course actions.
  4. Scope names and icons display correctly for individual and aggregate scopes.
  5. Removal dialogs correctly describe all courses or libraries within an organization or across the platform.

Related tests are updated to use the shared permission actions and scope types.

@dcoa
dcoa added this pull request to stack #265 October 15, 2026 03:27
@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.95%. Comparing base (b438b0a) to head (4c36a98).

Additional details and impacted files
@@                      Coverage Diff                       @@
##           dcoa/catalog-6-team-tables     #269      +/-   ##
==============================================================
- Coverage                       98.98%   98.95%   -0.03%     
==============================================================
  Files                              81       78       -3     
  Lines                            1474     1442      -32     
  Branches                          489      474      -15     
==============================================================
- Hits                             1459     1427      -32     
  Misses                             15       15              

☔ 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-7-remove-hardcoded branch from da7dd64 to 826dbd6 Compare October 15, 2026 07:06
@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch 2 times, most recently from ae05576 to a5663c9 Compare October 15, 2026 08:50
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Oct 22, 2026
@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch from a5663c9 to 7422db9 Compare October 29, 2026 06:47
@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch from 7422db9 to 017b2f6 Compare October 29, 2026 08:09
@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch from 017b2f6 to 8e4c07f Compare October 29, 2026 08:29
@dcoa
dcoa marked this pull request as ready for review October 29, 2026 08:48
@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch 2 times, most recently from 46a8612 to 3683d22 Compare November 4, 2026 08:03
@mphilbrick211 mphilbrick211 moved this from Waiting on Author to Ready for Review in Contributions Nov 4, 2026
@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch from 3683d22 to 4ff123d Compare November 5, 2026 02:27
@dcoa
dcoa requested review from bra-i-am and jesusbalderramawgu and removed request for bra-i-am November 5, 2026 02:39
@dcoa
dcoa requested review from bra-i-am and jacobo-dominguez-wgu and removed request for jesusbalderramawgu November 5, 2026 02:39

@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 everything works as expected.

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

LGTM!!

@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch 3 times, most recently from 2754cc8 to 85ff9cc Compare November 10, 2026 02:56
dcoa and others added 2 commits November 12, 2026 07:58
Delete the hardcoded roles, categories and permissions of courses and
libraries, the old role and permission types, and CONTENT_*_PERMISSIONS.
The team permissions the code checks now live in the authz constants,
per scope type: MANAGE_TEAM_ACTIONS next to VIEW_TEAM_ACTIONS, and the
validate/me lists built from them.

Replace CONTEXT_TYPES with the scope types: getScopeType reads the scope
type from a scope key, and the aggregate scope labels are keyed by it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch from 85ff9cc to 8317f2f Compare November 11, 2026 20:59
@dcoa
dcoa merged commit 915ffce 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-7-remove-hardcoded 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