mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not serialize user fields unless they are specified for display (#6736)
This commit is contained in:
@@ -104,4 +104,15 @@ module UserGuardian
|
||||
true
|
||||
end
|
||||
|
||||
def allowed_user_field_ids(user)
|
||||
@allowed_user_field_ids ||= {}
|
||||
@allowed_user_field_ids[user.id] ||=
|
||||
begin
|
||||
if is_staff? || is_me?(user)
|
||||
UserField.pluck(:id)
|
||||
else
|
||||
UserField.where("show_on_profile OR show_on_user_card").pluck(:id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user