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

Allow sending report only to admins (fixes #2414) #5350

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Nutomic
Copy link
Member

@Nutomic Nutomic commented Jan 24, 2025

This adds a new parameter to_local_admins for all report tables in the db, and all create report api parameters. This way most reports are only shown to community mods by default, and not to admins. It resolves the problems described in #2414 and Report Inboxes RFC with minimal changes (no new db tables or api endpoints).

By default admins only see reports marked to_local_admins (for important rule violations), and reports of communities they moderate themselves. Additionally reports which are unresolved for more than three days are shown to admins, in order to help out with unmoderated communities. There is also a parameter ListReports.show_mod_reports which allows admins to view all reports.

// which have `to_local_admins == false`.
query = query
.filter(filter_is_mod)
.filter(filter_to_local_admins.is_distinct_from(true));
Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to move this into a helper function fn filter(&mut query) but they generic parameters get very confusing. Worst case we have to copy-paste this whole filter logic into get_report_count().

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.

1 participant