mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Making sure remove post also checks higher mods or admins.
This commit is contained in:
parent
ed0ecf6418
commit
2bade7f31f
@ -5,7 +5,7 @@ use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
post::{PostResponse, RemovePost},
|
||||
send_activity::{ActivityChannel, SendActivityData},
|
||||
utils::check_community_mod_action,
|
||||
utils::{check_community_mod_action, check_is_higher_mod_or_admin},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
@ -37,6 +37,14 @@ pub async fn remove_post(
|
||||
)
|
||||
.await?;
|
||||
|
||||
check_is_higher_mod_or_admin(
|
||||
&mut context.pool(),
|
||||
&local_user_view,
|
||||
orig_post.community_id,
|
||||
&[orig_post.creator_id],
|
||||
)
|
||||
.await?;
|
||||
|
||||
// Update the post
|
||||
let post_id = data.post_id;
|
||||
let removed = data.removed;
|
||||
|
Loading…
Reference in New Issue
Block a user