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

Admins can view all reports. Fixes #1810 #1825

Merged
merged 1 commit into from
Oct 12, 2021
Merged

Conversation

dessalines
Copy link
Member

No description provided.

@dessalines
Copy link
Member Author

Okay I tested this locally, seems to work well.

@dessalines dessalines marked this pull request as ready for review October 8, 2021 14:15
community_moderator::table.on(
community_moderator::community_id
.eq(post::community_id)
.and(community_moderator::person_id.eq(my_person_id)),
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the main thing here. Moved this filter to an admin check below, so it will only filter for the communities you mod if you aren't an admin.

pub fn get_report_count(
conn: &PgConnection,
my_person_id: PersonId,
admin: bool,
community_id: Option<CommunityId>,
Copy link
Member

Choose a reason for hiding this comment

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

How about just passing the PersonView, so you dont have to pass id and admin as separate params?

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'd rather not pass whole views in order to build other views, all of these view methods should only require ids and bool flags. There's probably a way to do this even better with a smart query but this one in easy enough.

@Nutomic Nutomic merged commit 8645989 into main Oct 12, 2021
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.

2 participants