Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin filter for user listing #123

Merged
merged 1 commit into from Sep 8, 2023

Conversation

JacksonChen666
Copy link
Collaborator

@JacksonChen666 JacksonChen666 commented Sep 2, 2023

the admin filter is a tri-state, meaning it can filter for admins, filter for non-admins, and not filter at all.

fixes #122

NOTE: It is a draft PR because I am looking for a cleaner solution of "the user said no based on this flag here" rather than the current manual solution of checking. If that's not possible, then this is pretty much complete. found a cleaner solution

@JacksonChen666 JacksonChen666 force-pushed the user-list-admin-filter branch 2 times, most recently from d27d265 to c6dbb12 Compare September 2, 2023 22:48
the admin filter is a tri-state, meaning it can filter for admins,
filter for non-admins, and not filter at all.

available since synapse 1.91.0
(https://github.com/matrix-org/synapse/releases/tag/v1.91.0)

fixes JOJ0#122

References: JOJ0#122
@JacksonChen666 JacksonChen666 marked this pull request as ready for review September 2, 2023 23:24
@JacksonChen666
Copy link
Collaborator Author

merging because i've already tested and it works

@JacksonChen666 JacksonChen666 merged commit 9de5cdc into JOJ0:master Sep 8, 2023
1 check passed
@a-0-dev
Copy link

a-0-dev commented Sep 14, 2023

This was a breaking change for us (using synadm for scripting). The user_list_paginate function uses user_list, but the call of user_list was not updated to include some setting for the admin filter, so calling user_list_paginate inherently fails.

Correct me if I'm wrong, but to me it looks like this may be the problem, so potenially just fixing api.py:471 or extending user_list_paginate's signature with the admin filter would be sufficient. If doing the latter, please consider putting a default value for the admin filter so there's no permanent breaking change for others using the function :)

Thanks for your work on synadm, we highly appreciate it!

@JacksonChen666
Copy link
Collaborator Author

JacksonChen666 commented Sep 14, 2023

@a-0-dev Thank you for your report, please do create issues in the issue tracker the next time you spot an issue. The issue you found has been made at #127.

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.

Admin user filter in user list API
2 participants