Xyphyn / photon

An opinionated web client for Lemmy to help users discover the fediverse.
https://phtn.app
GNU Affero General Public License v3.0
386 stars 43 forks source link

Add a page in Community settings to manage banned users #462

Open DraconicNEO opened 1 month ago

DraconicNEO commented 1 month ago

Is your feature request related to a problem? Please describe. If I need to ban a known ban evader's alts I can't actually ban them from the community normally until they post a comment. Another situation is if someone was banned a long time ago and I want to lift their ban I also have to find one of their posts or comments in the community to do so, which might be difficult. The only alternative is manually using the API through browser DevTools or Postman but that's clunky and not user friendly.

Describe the solution you'd like It would be very nice if we had a page in the community settings screen where you can see a list of all banned users, with options to unban them there, or to add more users to the list. Similar to the page that lets you manage your moderator team.

Describe alternatives you've considered I don't really think there is any good alternative, using the API manually is clunky and having a UI to manage bans is a superior solution than requiring mods to use the API in the situations I described.

Additional context No response

Xyphyn commented 1 month ago

I was gonna ask this, but I literally couldn't find the API call to manage banned users. Where did you find that?

DraconicNEO commented 1 month ago

You make a call to https://instance.tld/api/v3/community/ban_user to ban and unban users from a community

Request data looks like this: {"community_id":[Internal ID of the community],"person_id":[UserID of the person],"ban":true,"remove_data":false,"reason":"[reason text]"}

Whether it is a ban or an unban is determined by if ban is true or false, true = banned, false = unbanned.

Xyphyn commented 1 month ago

That's the API call to ban someone. There's no API call to retrieve all the currently banned users. I could technically store it locally, but that's a bad idea for many reasons

DraconicNEO commented 1 month ago

That's the API call to ban someone. There's no API call to retrieve all the currently banned users. I could technically store it locally, but that's a bad idea for many reasons

Oh, yeah that might be difficult. I'm not really sure how or if there is a native API call to do that.

Xyphyn commented 1 month ago

Re read the issue. You want to be able to just ban a user spontaneously, will add soon