In apub post receive, check posting restricted to mods (ref #2702) (#2704)

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
Nutomic 2023-02-06 02:31:09 +09:00 committed by GitHub
parent 2891856b48
commit 7c1a37d584
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ use chrono::NaiveDateTime;
use lemmy_api_common::{
context::LemmyContext,
request::fetch_site_data,
utils::local_site_opt_to_slur_regex,
utils::{is_mod_or_admin, local_site_opt_to_slur_regex},
};
use lemmy_db_schema::{
self,
@ -173,6 +173,9 @@ impl ApubObject for ApubPost {
.dereference(context, local_instance(context).await, request_counter)
.await?;
let community = page.community(context, request_counter).await?;
if community.posting_restricted_to_mods {
is_mod_or_admin(context.pool(), creator.id, community.id).await?;
}
let mut name = page
.name
.clone()