referer.to_s
end
+
+ def scope_enabled?(scope)
+ doorkeeper_token&.includes_scope?(scope) || current_token&.includes_scope?(scope)
+ end
+
+ helper_method :scope_enabled?
end
json.count user.sent_messages.size
end
end
+
+ json.email user.email if scope_enabled?(:read_email)
end
end
: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
read_gpx: Read private GPS traces
write_gpx: Upload GPS traces
write_notes: Modify notes
+ read_email: Read user email address
oauth_clients:
new:
title: "Register a new application"
module Oauth
SCOPES = %w[read_prefs write_prefs write_diary write_api read_gpx write_gpx write_notes].freeze
- PRIVILEGED_SCOPES = %w[].freeze
+ PRIVILEGED_SCOPES = %w[read_email].freeze
class Scope
attr_reader :name