json.account_created user.creation_time.xmlschema
json.description user.description if user.description
- if current_user && current_user == user
+ if current_user && current_user == user && can?(:details, User)
json.contributor_terms do
json.agreed user.terms_agreed.present?
json.pd user.consider_pd
end
end
- if current_user && current_user == user
+ if current_user && current_user == user && can?(:details, User)
if user.home_lat && user.home_lon
json.home do
json.lat user.home_lat
end
end
- if user.languages
- json.languages do
- json.array! user.languages.split(",")
- end
- end
+ json.languages user.languages if user.languages?
json.messages do
json.received do
json.count user.sent_messages.size
end
end
+
+ json.email user.email if scope_enabled?(:read_email)
end
end