diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb index 25cc764898f..476601b0fbd 100644 --- a/app/serializers/user_serializer.rb +++ b/app/serializers/user_serializer.rb @@ -333,8 +333,13 @@ class UserSerializer < BasicUserSerializer def custom_fields fields = nil + if scope.can_edit?(object) + fields = DiscoursePluginRegistry.serialized_current_user_fields.to_a + end + if SiteSetting.public_user_custom_fields.present? - fields = SiteSetting.public_user_custom_fields.split('|') + fields ||= [] + fields += SiteSetting.public_user_custom_fields.split('|') end if fields.present?