Skip to content

feat(authz): assign a role from the roles table row menu - #286

Open
jacobo-dominguez-wgu wants to merge 2 commits into
jacobo/roles-table-customfrom
jacobo/assign-role-row
Open

jacobo-dominguez-wgu wants to merge 2 commits into
jacobo/roles-table-customfrom
jacobo/assign-role-row

Conversation

@jacobo-dominguez-wgu

@jacobo-dominguez-wgu jacobo-dominguez-wgu commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

The "Assign role" item in each roles table row menu now opens the assign role wizard with that row's role preselected. It reuses the existing wizard and assignment endpoint; the new work is opening the wizard with a role already selected.

Closes openedx/openedx-authz#570

Changes

  • Shared assignable-roles hook: useAssignableRoleGroups (in role-assignation-wizard/hooks/) moves the rules out of AddRoleButton.
    • It decides which roles a user may assign: the user must be able to manage that resource type's team, and the course-authoring flag must be on for course roles.
    • AddRoleButton and the roles table now share it. AddRoleButton behaves the same.
  • Preselected role in the wizard: new initialRole prop on AssignRoleWizard. The role stays changeable and is restored after Cancel.
    • It is ignored unless the role is one the user may assign.
    • If the roles are still loading when the wizard opens, it applies once they arrive. It never overwrites a role the user already picked.
  • Row menu:
    • "Assign role" opens the wizard with the row's role selected.
    • The item is hidden when the user can't assign that role.
    • The table hosts one wizard and mounts it only while open, as AddRoleButton does.
  • RoleAssignmentContext: gives the action cells the assignment state. DataTable keeps the action column's cells from its first render, so a cell factory would hold the permissions from before they finished loading.

Testing

  1. Go to the Roles and Permissions Tab
  2. Open the ⋮ menu of Library Author.
    • Expected: it shows Duplicate and Assign role.
  3. Click Assign role.
    • Expected: the Assign Role modal opens with Library Author selected.

Demo

Screen.Recording.2026-11-18.at.11.14.48.AM.mov

Notes for reviewers

  • Stacked on jacobo/roles-table-custom, which holds the roles table.

@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 Nov 10, 2026
@openedx-webhooks

openedx-webhooks commented Nov 10, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @jacobo-dominguez-wgu!

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 Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.07%. Comparing base (9d6e732) to head (a823da8).

Additional details and impacted files
@@                      Coverage Diff                      @@
##           jacobo/roles-table-custom     #286      +/-   ##
=============================================================
+ Coverage                      99.05%   99.07%   +0.01%     
=============================================================
  Files                             88       90       +2     
  Lines                           1580     1614      +34     
  Branches                         485      494       +9     
=============================================================
+ Hits                            1565     1599      +34     
  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.

@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Nov 16, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Nov 16, 2026
@jacobo-dominguez-wgu
jacobo-dominguez-wgu marked this pull request as ready for review November 18, 2026 17:16
@jacobo-dominguez-wgu jacobo-dominguez-wgu moved this from Waiting on Author to Ready for Review in Contributions Nov 18, 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). mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

Frontend: Assign role from the Roles and Permissions row menu

6 participants