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

Fixing modlog filtering to allow admins and mods to filter by mod. #2629

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/shared/components/modlog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,9 @@ export class Modlog extends Component<ModlogRouteProps, ModlogState> {
options={userSearchOptions}
loading={loadingUserSearch}
/>
{!this.isoData.site_res.site_view.local_site
.hide_modlog_mod_names && (
{(this.amAdminOrMod ||
!this.isoData.site_res.site_view.local_site
.hide_modlog_mod_names) && (
Comment on lines +910 to +912
Copy link
Member

Choose a reason for hiding this comment

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

If I'm not mistaken, this will allow anyone who is a mod of a community to filter by mod even when looking at actions for communities they aren't a mod of.

Copy link
Member Author

Choose a reason for hiding this comment

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

We should be okay, check the this.amModOrAdmin function.

<Filter
filterType="mod"
onChange={this.handleModChange}
Expand Down