mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
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:

committed by
Penar Musaraj

parent
6350ba2cb3
commit
76bdea5ce2
@ -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?
|
||||
|
Reference in New Issue
Block a user