Skip to content

Backend endpoint to list and filter users (to be used by sysadmins)#64

Merged
minh-biocommons merged 5 commits into
mainfrom
admin-filter-users
Sep 3, 2025
Merged

Backend endpoint to list and filter users (to be used by sysadmins)#64
minh-biocommons merged 5 commits into
mainfrom
admin-filter-users

Conversation

@minh-biocommons

@minh-biocommons minh-biocommons commented Sep 2, 2025

Copy link
Copy Markdown
Collaborator

Description

AAI-290: Back-end endpoint to list and filter users (to be used by sysadmins)

Changes

  • Added filter function for the /admin/users endpoint
  • Add a new endpoint to get the list of filter options for the user list
  • Updated to the correct naming convention from "bpa-galaxy" to "bpa_galaxy"
  • Updated/added relevant tests

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit / integration tests that prove my fix is effective or that my feature works
  • I have run all tests locally and they pass
  • I have updated the documentation (if applicable)

@minh-biocommons

Copy link
Copy Markdown
Collaborator Author

This is a PR for adding filter functionality to the admin’s GET /users endpoint. I’m not really sure where the platforms and groups/bundles definitions should live, so for now they’re a bit scattered between models/biocommons_register and admin. We can refactor later once we decide on a single point of reference.

amandazhuyilan
amandazhuyilan previously approved these changes Sep 2, 2025

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

Overall no concerns except for suggestion of the Enum group for BiocommonsGroupEnum :) Thanks for the change.

Comment thread db/models.py
Comment thread routers/admin.py

@marius-mather marius-mather left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've made a few comments about possible changes to the database/refactoring how we store information about groups and platforms - those are up for discussion and don't need to be done in this PR.

But my main comment on this is that I think we should have separate filters for group and platform, rather than trying to have a magic all-purpose filter. That will make it easier to add more filters in future, and also allow combining multiple filters.

Comment thread routers/admin.py
Comment thread db/models.py
Comment thread routers/admin.py
Comment thread routers/admin.py

@marius-mather marius-mather left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Happy to merge this so we have an implementation of the current design - I will do some thinking around some of the refactoring that could make this a bit cleaner.

@minh-biocommons minh-biocommons merged commit a09fe13 into main Sep 3, 2025
2 checks passed
@amandazhuyilan amandazhuyilan deleted the admin-filter-users branch September 16, 2025 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants