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

Add a can_mod field to CommentView, PostView to help with moderation abilities. #4365

Open
4 tasks done
dessalines opened this issue Jan 11, 2024 · 0 comments · May be fixed by #5398
Open
4 tasks done

Add a can_mod field to CommentView, PostView to help with moderation abilities. #4365

dessalines opened this issue Jan 11, 2024 · 0 comments · May be fixed by #5398
Milestone

Comments

@dessalines
Copy link
Member

dessalines commented Jan 11, 2024

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?

Lemmy's moderation abilities are based on a top down hierarchy: a list of admins, then mods. No one can do mod-related actions on someone higher than them in the hierarchy.

Unfortunately for UIs, this means that every place where moderation is possible, must pass:

  • A list of admins
  • A list of community mods
  • Your person_id
  • The content creator's person_id

This is cumbersome and potentially a performance hit, since some threads have thousands of comments, and these lists and logic must be performed repeatedly in the front ends.

IE the logic of whether you can_mod something, is duplicated across front and back ends.

Describe the solution you'd like.

  1. Add a can_mod field to every moddable item: PostView, CommentView, and a few others.

This should be possible with postgres.

One other complication: occasionally you can_mod your own content, but that should already be taken care of by creator == myId and creator_is_mod in the front ends.

Describe alternatives you've considered.

N/A

Additional context

See LemmyNet/jerboa#1323 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant