Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Allow filtering for admins in the list accounts admin API#16114

Merged
DMRobertson merged 2 commits intomatrix-org:developfrom
bwi-de:pr/filter-admins
Aug 18, 2023
Merged

Allow filtering for admins in the list accounts admin API#16114
DMRobertson merged 2 commits intomatrix-org:developfrom
bwi-de:pr/filter-admins

Conversation

@afechler
Copy link
Copy Markdown
Contributor

@afechler afechler commented Aug 15, 2023

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Pull request includes a sign off
  • Code style is correct
    (run the linters)

@afechler afechler requested a review from a team as a code owner August 15, 2023 12:43
@clokep
Copy link
Copy Markdown
Member

clokep commented Aug 15, 2023

@afechler Please sign-off on your changes.

Comment thread docs/admin_api/user_admin_api.md Outdated
Comment thread synapse/storage/databases/main/__init__.py Outdated
Comment thread tests/rest/admin/test_user.py Outdated
Comment thread tests/rest/admin/test_user.py
Comment on lines +227 to +231
filters.append("admin = 1")
else:
filters.append("admin = 0")
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.

Aside: I wonder if this was missed in #15515?

Copy link
Copy Markdown
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

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

I'd like to see the docs and docstring phrasing changed; everything else is a nice-to-have.

Comment thread changelog.d/16114.feature Outdated
@@ -0,0 +1 @@
Query-Parameter added to Admin-API /users to filter admins from user list. No newline at end of file
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.

Suggested change
Query-Parameter added to Admin-API /users to filter admins from user list.
Add an `admins` query parameter to the [List Accounts](https://matrix-org.github.io/synapse/v1.91/admin_api/user_admin_api.html#list-accounts) [admin API](https://matrix-org.github.io/synapse/v1.91/usage/administration/admin_api/index.html), to include only admins or to exclude admins in user queries.

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.

Sorry, I missed the changelog earlier.

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.

I have adopted the text.

Signed-off-by: Alexander Fechler <alexander.fechler@bwi.de>
Copy link
Copy Markdown
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

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

Thanks, I'm happy if CI is!

@DMRobertson
Copy link
Copy Markdown
Contributor

DMRobertson commented Aug 18, 2023

CI passed except for a flake on 48feabf, going to merge manually.

@DMRobertson DMRobertson changed the title Query parameter added to filter admins. Allow filtering for admins in the list accounts admin API Aug 18, 2023
@DMRobertson DMRobertson merged commit 54317d3 into matrix-org:develop Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants