Making community ban or add mod also allow higher admins.

This commit is contained in:
Dessalines 2024-07-07 13:08:45 -04:00
parent e3da031b61
commit ed0ecf6418
2 changed files with 4 additions and 4 deletions

View file

@ -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,

View file

@ -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,