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 community mods to view votes in addition to admins #4386

Closed
4 tasks done
SleeplessOne1917 opened this issue Jan 19, 2024 · 4 comments · Fixed by #4392
Closed
4 tasks done

Allow community mods to view votes in addition to admins #4386

SleeplessOne1917 opened this issue Jan 19, 2024 · 4 comments · Fixed by #4392
Labels
enhancement New feature or request

Comments

@SleeplessOne1917
Copy link
Member

Requirements

  • Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a feature request? Do not put multiple feature requests in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Is your proposal related to a problem?

There is a PR open on the UI repo requesting the new view votes feature for admins be extended to community mods as well. This will require a backend change to implement.

Describe the solution you'd like.

If a comment or post was made in a community, moderators of that community should be able to view votes on it.

Describe alternatives you've considered.

n/a

Additional context

n/a

@SleeplessOne1917 SleeplessOne1917 added the enhancement New feature or request label Jan 19, 2024
@Asudox
Copy link

Asudox commented Jan 20, 2024

Why though?

@Nutomic
Copy link
Member

Nutomic commented Jan 22, 2024

Would be as simple as changing this line to is_mod_or_admin, and adjusting the params/imports.

@SleeplessOne1917
Copy link
Member Author

@Nutomic In addition to the person being checked, is_mod_or_admin needs a db pool and the ID of the community. The ListPostLikes request body has post ID, limit, and page. I imagine the DB pool is already available via an actix extractor, but getting the community ID seems like it will require more work.

@Asudox This change should make it easier to spot vote manipulation.

@Nutomic
Copy link
Member

Nutomic commented Jan 22, 2024

You have to call Post::read with the given post id, then the resulting post contains the community_id. Db pool is available from context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants