Add a privileged scope that allows email addresses to be returned

This commit is contained in:
Tom Hughes 2021-07-30 22:39:39 +01:00
parent 6c6e8883f7
commit f4d1d97848
5 changed files with 11 additions and 1 deletions

View file

@ -65,5 +65,7 @@ json.user do
json.count user.sent_messages.size
end
end
json.email user.email if scope_enabled?(:read_email)
end
end

View file

@ -40,5 +40,6 @@ xml.tag! "user", :id => user.id,
:unread => user.new_messages.size
xml.tag! "sent", :count => user.sent_messages.size
end
xml.tag! "email", user.email if scope_enabled?(:read_email)
end
end