This commit is contained in:
Felix Ableitner 2024-03-01 17:21:10 +01:00
parent 16bd481aa8
commit 71eb3faebc
2 changed files with 6 additions and 2 deletions

View file

@ -56,7 +56,9 @@ pub async fn create_comment(
check_post_deleted_or_removed(&post)?;
// Check if post is locked, no new comments
let is_mod_or_admin = is_mod_or_admin(&mut context.pool(), local_user_view.person, community_id)?;
let is_mod_or_admin = is_mod_or_admin(&mut context.pool(), &local_user_view.person, community_id)
.await
.is_ok();
if post.locked && !is_mod_or_admin {
Err(LemmyErrorType::Locked)?
}

View file

@ -143,7 +143,9 @@ impl Object for ApubComment {
verify_person_in_community(&note.attributed_to, &community, context).await?;
let (post, _) = note.get_parents(context).await?;
let creator = note.attributed_to.dereference(context).await?;
let is_mod_or_admin = is_mod_or_admin(&mut context.pool(), creator, community.id)?;
let is_mod_or_admin = is_mod_or_admin(&mut context.pool(), &creator, community.id)
.await
.is_ok();
if post.locked && !is_mod_or_admin {
Err(LemmyErrorType::PostIsLocked)?
} else {