eya,
@eya@lemmy.dbzer0.com avatar

If you need to block your local instance admin then you probably shouldn’t be using that instance…

skullgiver, (edited )
@skullgiver@popplesburger.hilciferous.nl avatar

Source code for the code responsible for this error message:


<span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">let</span><span style="color:#323232;"> target_user </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">LocalUserView::read_person(</span><span style="font-weight:bold;color:#a71d5d;">&mut</span><span style="color:#323232;"> context.</span><span style="color:#62a35c;">pool</span><span style="color:#323232;">(), target_id).await;
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if</span><span style="color:#323232;"> target_user.</span><span style="color:#62a35c;">map</span><span style="color:#323232;">(|t| t.local_user.admin) </span><span style="font-weight:bold;color:#a71d5d;">== </span><span style="color:#0086b3;">Ok</span><span style="color:#323232;">(</span><span style="color:#0086b3;">true</span><span style="color:#323232;">) {
</span><span style="color:#323232;">    </span><span style="color:#0086b3;">Err</span><span style="color:#323232;">(LemmyErrorType::CantBlockAdmin)</span><span style="font-weight:bold;color:#a71d5d;">?
</span><span style="color:#323232;">  }
</span>

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):

  1. Go to your account settings
  2. Export your user profile
  3. Add the user you wish to block to the blocked_users list (make sure to stick to the JSON format)
  4. Import your backup

It looks like the code for importing settings does not execute the admin check.

effward,
@effward@lemmy.world avatar

I love that you found this workaround, but arguably that code path should do the admin check, too.

skullgiver,
@skullgiver@popplesburger.hilciferous.nl avatar

I agree, I think it was just an oversight. Based on the context, it seems like the code assumes that error handling for anything but “database is gone” is unnecessary. Doing user lookups with those assumptions may be difficult, and I don’t think the Lemmy devs were trying to protect against shenanigans like these.

I don’t really see what you would gain from blocking a local admin (not like the admin is any less powerful to take action against you) so I wouldn’t expect it to be that bad. I’m a little surprised it’s not possible to block admins in the first place.

I can’t be bothered to actually check if the import does indeed allow blocking local instance admins; I just assumed so based on a quick read of the code. This seems like a rather unimportant bug, but if someone cares they should probably file an issue (or, even better, a pull request).

Annoyed_Crabby,

Have you tried turning it off and on again?

MurrayL,

It’s like RoboCop having a meltdown when he tries to arrest an OCP officer

Superwidget,

What a reference! Amazing

syd,
@syd@lemy.lol avatar

sad sunaurus noises

Ilovethebomb,

Not being able to block a moderator is genuinely hilarious.

Sheeple,
@Sheeple@lemmy.world avatar

Works fine on Sync :,)

cypherpunks, (edited )
@cypherpunks@lemmy.ml avatar

Works fine on Sync :,)

It sounds like Sync is either blocking users client-side (which would be confusing, since server-side blocks do exist), or it is trying and failing to add a block server-side but suppressing the server’s error message.

either way, it sounds like a bug.

do you know where the project’s github is so someone can open an issue about it? /s (explanation here on mouseover)

PsychedSy,

Sync has filtering done in-app. Maybe that’s what they’re referring to.

And when reddit went ham on third party apps the developer asked his users what to do and we asked him to port to lemmy.

sndrtj,

Sync filters a lot in client.

TrickDacy,

Is it? I don’t get it. I thought this is just how Lemmy and reddit both work.

MentalEdge, (edited )
@MentalEdge@sopuli.xyz avatar

You can definitely block mods, and also admins of other instances.

But I don’t think you can block your own instances admins, but if those people are worth blocking maybe you shouldn’t be on that instance…

Ilovethebomb,

Fair enough.

CluckN,

Does blocking mean the blocked user can no longer see your posts/activity? Therefore blocking a mod would make it harder for them to ban you?

joyjoy,

Blocking means you no longer see their posts, and they can’t comment on any of your posts. If they’ve already commented or replied to you, the messages are deleted (hidden?).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • lemmyshitpost@lemmy.world
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #