diff --git a/crates/app/src/routes/pages/communities.rs b/crates/app/src/routes/pages/communities.rs index 8de6c41..453157b 100644 --- a/crates/app/src/routes/pages/communities.rs +++ b/crates/app/src/routes/pages/communities.rs @@ -635,6 +635,20 @@ pub async fn post_request( check_user_blocked_or_private!(user, owner, data, jar); + if owner.permissions.check_banned() { + if let Some(ref ua) = user { + if !ua.permissions.check(FinePermission::MANAGE_POSTS) { + return Err(Html( + render_error(Error::NotAllowed, &jar, &data, &user).await, + )); + } + } else { + return Err(Html( + render_error(Error::NotAllowed, &jar, &data, &user).await, + )); + } + } + // check repost let reposting = data.0.get_post_reposting(&post, &ignore_users, &user).await; diff --git a/crates/core/src/database/posts.rs b/crates/core/src/database/posts.rs index 1b1d76c..09e855b 100644 --- a/crates/core/src/database/posts.rs +++ b/crates/core/src/database/posts.rs @@ -198,6 +198,10 @@ impl DataManager { } else { let ua = self.get_user_by_id(owner).await?; + if ua.permissions.check_banned() { + continue; + } + // check relationship if ua.settings.private_profile { // if someone were to look for places to optimize memory usage, @@ -304,6 +308,10 @@ impl DataManager { } else { let ua = self.get_user_by_id(owner).await?; + if ua.permissions.check_banned() { + continue; + } + // check relationship if ua.settings.private_profile && ua.id != user_id { if user_id == 0 {