Only allow distinguishing own comments (fixes #4216) (#4222)

This commit is contained in:
Nutomic 2023-12-01 15:16:22 +01:00 committed by GitHub
parent 70003407a7
commit 809fc05cb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,11 @@ pub async fn distinguish_comment(
)
.await?;
// Verify that only the creator can distinguish
if local_user_view.person.id != orig_comment.creator.id {
Err(LemmyErrorType::NoCommentEditAllowed)?
}
// Verify that only a mod or admin can distinguish a comment
check_community_mod_action(
&local_user_view.person,