Adding modlog private site check.

This commit is contained in:
Dessalines 2021-12-14 12:58:32 -05:00
parent a90d5a40d8
commit 86a4d9b112
2 changed files with 7 additions and 0 deletions

View File

@ -77,6 +77,12 @@ impl Perform for GetModlog {
) -> Result<GetModlogResponse, LemmyError> {
let data: &GetModlog = self;
let local_user_view =
get_local_user_view_from_jwt_opt(data.auth.as_ref(), context.pool(), context.secret())
.await?;
check_private_instance(&local_user_view, context.pool()).await?;
let community_id = data.community_id;
let mod_person_id = data.mod_person_id;
let page = data.page;

View File

@ -72,6 +72,7 @@ pub struct GetModlog {
pub community_id: Option<CommunityId>,
pub page: Option<i64>,
pub limit: Option<i64>,
pub auth: Option<Sensitive<String>>,
}
#[derive(Debug, Serialize, Deserialize)]