Skip to content

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

Open
dcoa wants to merge 1 commit into
dcoa/catalog-6-team-tablesfrom
dcoa/catalog-7-remove-hardcoded
Open

dcoa wants to merge 1 commit 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.92%. Comparing base (1f39bf9) to head (7992c90).

Additional details and impacted files
@@                      Coverage Diff                       @@
##           dcoa/catalog-6-team-tables     #269      +/-   ##
==============================================================
- Coverage                       98.94%   98.92%   -0.02%     
==============================================================
  Files                              82       79       -3     
  Lines                            1416     1392      -24     
  Branches                          473      429      -44     
==============================================================
- Hits                             1401     1377      -24     
  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
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 <noreply@anthropic.com>
@dcoa
dcoa force-pushed the dcoa/catalog-7-remove-hardcoded branch from 8e4c07f to 7992c90 Compare October 29, 2026 09:04
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: Waiting on Author

Development

Successfully merging this pull request may close these issues.

2 participants