Zevlen@lemm.ee to Lemmy Shitpost@lemmy.worldEnglish · 10 months agoCan't block admin?lemm.eeimagemessage-square28fedilinkarrow-up1203arrow-down110file-text
arrow-up1193arrow-down1imageCan't block admin?lemm.eeZevlen@lemm.ee to Lemmy Shitpost@lemmy.worldEnglish · 10 months agomessage-square28fedilinkfile-text
minus-squareSkull giver@popplesburger.hilciferous.nllinkfedilinkarrow-up88·edit-210 months agoSource code for the code responsible for this error message: let target_user = LocalUserView::read_person(&mut context.pool(), target_id).await; if target_user.map(|t| t.local_user.admin) == Ok(true) { Err(LemmyErrorType::CantBlockAdmin)? } You can’t block local instance admins. You can ban external admins (those on other servers), and moderators, though. Blocking admins doesn’t make much sense anyway, because admins can probably remove the block from the database if they wanted to be malicious. As a workaround, you can try the following (requires Lemmy 0.19.0 or higher): Go to your account settings Export your user profile Add the user you wish to block to the blocked_users list (make sure to stick to the JSON format) Import your backup It looks like the code for importing settings does not execute the admin check.
minus-squareeffward@lemmy.worldlinkfedilinkEnglisharrow-up41·10 months agoI love that you found this workaround, but arguably that code path should do the admin check, too.
minus-squareSkull giver@popplesburger.hilciferous.nllinkfedilinkarrow-up16·edit-210 months agodeleted by creator
Source code for the code responsible for this error message:
let target_user = LocalUserView::read_person(&mut context.pool(), target_id).await; if target_user.map(|t| t.local_user.admin) == Ok(true) { Err(LemmyErrorType::CantBlockAdmin)? }
You can’t block local instance admins. You can ban external admins (those on other servers), and moderators, though.
Blocking admins doesn’t make much sense anyway, because admins can probably remove the block from the database if they wanted to be malicious.
As a workaround, you can try the following (requires Lemmy 0.19.0 or higher):
blocked_users
list (make sure to stick to the JSON format)It looks like the code for importing settings does not execute the admin check.
I love that you found this workaround, but arguably that code path should do the admin check, too.
deleted by creator