FEATURE: Hide suspended users from site-wide search to regular users (PR #14245)

Regular users were able to see suspended users when searching their username.

This is fine for admins, but not for regular users, unless specified by the new site setting regular_users_see_suspended_users_on_search.


There are two camps: those who say that unless is fine as long there’s only a single condition, and those who say unless is never okay :grinning_face_with_smiling_eyes: Either way:

    if !SiteSetting.enable_listing_suspended_users_on_search && !@guardian.user&.admin
      fab!(:suspended_user) { Fabricate(:user, username: 'revolver_ocelot', suspended_at: Time.now, suspended_till: 5.days.from_now) }

I’d change the wording here. Maybe “to search for suspended users” or “to find suspended users”?