UX: Improve naming for anonymous mode settings (#31832)

This PR renames a couple of settings related to anonymous mode:

1. `allow_anonymous_posting` → `allow_anonymous_mode`. This setting is
used as a switch for the entire anonymous mode feature, so it makes
sense to give it a generic name that better reflects what the setting
does.
2. `allow_anonymous_likes` → `allow_likes_in_anonymous_mode`. The new
name is clearer and will match a new setting that we'll add to allow
anonymous users to post in chat.

Internal topic: t/148088.
This commit is contained in:
Osama Sayegh
2025-03-21 04:54:06 +03:00
committed by GitHub
parent 8c8bc94ed8
commit f7f7642ae0
23 changed files with 113 additions and 40 deletions

View File

@ -277,6 +277,13 @@ module SiteSettings::Validations
validate_error :tl0_and_anonymous_flag
end
def validate_allow_likes_in_anonymous_mode(new_val)
return if new_val == "f"
return if SiteSetting.allow_anonymous_mode
validate_error :allow_likes_in_anonymous_mode_without_anonymous_mode_enabled
end
private
def validate_bucket_setting(setting_name, upload_bucket, backup_bucket)