SECURITY: Hide user profiles from public

User profiles, including the summary, should be private to anonymous
users if hide_user_profiles_from_public is enabled.
This commit is contained in:
Bianca Nenciu
2023-09-27 20:10:26 +03:00
committed by Penar Musaraj
parent 6350ba2cb3
commit 76bdea5ce2
3 changed files with 26 additions and 6 deletions

View File

@ -122,6 +122,10 @@ module UserGuardian
true
end
def public_can_see_profiles?
!SiteSetting.hide_user_profiles_from_public || !anonymous?
end
def can_see_profile?(user)
return false if user.blank?
return true if !SiteSetting.allow_users_to_hide_profile?