Skip to content

docs: Define api contract for User-Grouped role assignments - #437

Open
rodmgwgu wants to merge 8 commits into
openedx:mainfrom
WGU-Open-edX:docs/user-grouped-api
Open

docs: Define api contract for User-Grouped role assignments#437
rodmgwgu wants to merge 8 commits into
openedx:mainfrom
WGU-Open-edX:docs/user-grouped-api

Conversation

@rodmgwgu

@rodmgwgu rodmgwgu commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Closes: #405

The new Team Members tab design for the Admin Console requires fields that are not currently available in the API.

This ADR proposes the contract for updating the existing /api/authz/v1/users/ to support the new Team Members tab use cases.

Merge checklist:
Check off if complete or not applicable:

  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

AI Usage

Kiro was used to refine the prose and clarity of the text, help with rst formatting, as well as to assist on research.

The core ADR contents and direction were drafted by hand.

@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 Sep 2, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @rodmgwgu!

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

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 Sep 2, 2026
@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Sep 2, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Sep 2, 2026

Query Parameters:
"""""""""""""""""

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.

it is missing the roles filter

Suggested change
`roles`` (optional): Comma-separated list of roles to filter by (e.g. ``course_auditor,library_admin``).

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.

Good catch, I've added it, thanks!

"is_superadmin": false,
"role": "library_admin",
"org": "Org1",
"scope": "lib:Org1:LIB1",

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.

the table shows the name of the scope instead of the id

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.

Thanks for pointing this out. I added a new "scope_display_name" key and documented edge cases and implementation details.

- ``scopes`` (optional): Comma-separated list of scopes to filter by (e.g.
``lib:Org1:LIB1``).
- ``orgs`` (optional): Comma-separated list of orgs to filter by (e.g. ``Org1,Org2``).
- ``search`` (optional): Search term to filter users by username, full name, or email.

@carlos-marquez-wgu carlos-marquez-wgu Sep 3, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What is the full name field here? Is this something visible in the UI?

edit: I see it is just the user's full name, wondering if we should allow to search by this given is not visible in the UI, it can return results where the search string isn't visible, I think it might be confusing but maybe no big deal

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.

It's not being displayed in the design, but in past discussions with Guillermo we decided to include it in the search fields.

@mariajgrimaldi mariajgrimaldi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree with the current contract! I only have a few clarifying questions. Thanks a lot!

email: string
assignment_count: number
assignments: Array<{
is_superadmin: boolean

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought we removed this while we properly support django staff / superuser. Here are the relevant issues:
#347
#345

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.

Oh I wasn't aware of this, so we are no longer showing superadmins at all?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Until we figure out a more sustainable way to support them, yes

"full_name": "Jane Doe",
"email": "jane_doe@example.com",
"assignment_count": 3,
"assignments": [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm guessing this will return all types of assignments, right? Will the UI ever have a scope type filter?

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.

Yes, all type of assignments, the UI as I understand it only filters by specific scopes, not by type, but let me confirm this with María de los Ángeles.

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.

Confirmed by María de los Ángeles: it only filters by specific scopes.

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

Thanks for working on this! I only have a couple of suggestions.

Comment thread docs/decisions/0024-api-contract-for-user-grouped-role-assignments.rst Outdated
Comment thread docs/decisions/0024-api-contract-for-user-grouped-role-assignments.rst Outdated
Comment thread docs/decisions/0024-api-contract-for-user-grouped-role-assignments.rst Outdated
Comment thread docs/decisions/0024-api-contract-for-user-grouped-role-assignments.rst Outdated
Comment thread docs/decisions/0024-api-contract-for-user-grouped-role-assignments.rst Outdated
``lib:Org1:LIB1``).
- ``orgs`` (optional): Comma-separated list of orgs to filter by (e.g. ``Org1,Org2``).
- ``search`` (optional): Search term to filter users by username, full name, or email.
- ``assignments_limit`` (optional): Maximum number of assignments to populate in

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.

Maybe we should set an upper limit for assignment_limit? That way, we prevent someone from requesting, for example, 1000 assignments with page_size=50, which could be quite expensive.

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.

what would be a good number? maybe 10?

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.

Yeah, I think 10 is fine.

Comment on lines +114 to +119
is_superadmin: boolean
role: string
org: string
scope: string
scope_display_name: string
permission_count: number

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.

I'd like to confirm if these fields in assignments are sufficient to display the information in the table correctly, especially when the scope is a Glob type (org and platform). I was thinking maybe it would be good to have a scope_type field?

cc @dcoa

@dcoa dcoa Sep 7, 2026

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.

Currently we identify glob scopes by the '*' in scope as you can see in PLATFORM_AGGREGATE_SCOPE_KEYS and ORG_AGGREGATE_SCOPE_BUILDERS here.

If we can guarantee that this convention is consistent across all scopes, then the current fields should be sufficient to display the information correctly.

Having a scope_type field isn't a bad idea if we want to be more explicit about the information encoded in scope itself. However, I think in that case, it would need to be a composite value, e.g. course-org-glob, (or adding another field) since simply having org or platform wouldn't tell us what type of resource the Glob applies to and we still need to relay on scope.

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.

Thanks for confirming that, @dcoa. In that case, if the value in the scope field is sufficient, we can go ahead with the fields defined in the ADR for now.

rodmgwgu and others added 6 commits September 4, 2026 09:14
…e-assignments.rst

Co-authored-by: Bryann Valderrama <bryann.valderrama@edunext.co>
…e-assignments.rst

Co-authored-by: Bryann Valderrama <bryann.valderrama@edunext.co>
…e-assignments.rst

Co-authored-by: Bryann Valderrama <bryann.valderrama@edunext.co>
…e-assignments.rst

Co-authored-by: Bryann Valderrama <bryann.valderrama@edunext.co>

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

For my part, I would just need to add a limit to the assignments_limit field (possibly 10). Thank you for your work!

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.

Backend: Define API contract for user-grouped data

7 participants