From ed0ecf64180c206a0f1423e611abe41adcd9d241 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 7 Jul 2024 13:08:45 -0400 Subject: [PATCH] Making community ban or add mod also allow higher admins. --- crates/api/src/community/add_mod.rs | 4 ++-- crates/api/src/community/ban.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/api/src/community/add_mod.rs b/crates/api/src/community/add_mod.rs index 4b65a4b10..9d9abf097 100644 --- a/crates/api/src/community/add_mod.rs +++ b/crates/api/src/community/add_mod.rs @@ -4,7 +4,7 @@ use lemmy_api_common::{ community::{AddModToCommunity, AddModToCommunityResponse}, context::LemmyContext, send_activity::{ActivityChannel, SendActivityData}, - utils::{check_community_mod_action, check_is_higher_mod}, + utils::{check_community_mod_action, check_is_higher_mod_or_admin}, }; use lemmy_db_schema::{ source::{ @@ -36,7 +36,7 @@ pub async fn add_mod_to_community( // If its a mod removal, also check that you're a higher mod. if !data.added { - check_is_higher_mod( + check_is_higher_mod_or_admin( &mut context.pool(), &local_user_view, community_id, diff --git a/crates/api/src/community/ban.rs b/crates/api/src/community/ban.rs index e6425c1ab..eb4021aef 100644 --- a/crates/api/src/community/ban.rs +++ b/crates/api/src/community/ban.rs @@ -7,7 +7,7 @@ use lemmy_api_common::{ utils::{ check_community_mod_action, check_expire_time, - check_is_higher_mod, + check_is_higher_mod_or_admin, remove_user_data_in_community, }, }; @@ -49,7 +49,7 @@ pub async fn ban_from_community( ) .await?; - check_is_higher_mod( + check_is_higher_mod_or_admin( &mut context.pool(), &local_user_view, data.community_id,