X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/8d76be71bbb8a799cbf0627dee170f26ade5a11f..7af9a60eccf55806a452186995b87ebab1b5b230:/lib/oauth.rb?ds=inline diff --git a/lib/oauth.rb b/lib/oauth.rb index 8f45a3b4b..679c564a6 100644 --- a/lib/oauth.rb +++ b/lib/oauth.rb @@ -1,5 +1,11 @@ module Oauth - SCOPES = %w[read_prefs write_prefs write_diary write_api read_gpx write_gpx write_notes].freeze + SCOPES = %w[ + read_prefs write_prefs write_diary + write_api read_gpx write_gpx write_notes write_redactions + consume_messages send_messages openid + ].freeze + PRIVILEGED_SCOPES = %w[read_email skip_authorization].freeze + MODERATOR_SCOPES = %w[write_redactions].freeze class Scope attr_reader :name @@ -13,7 +19,9 @@ module Oauth end end - def self.scopes - SCOPES.collect { |s| Scope.new(s) } + def self.scopes(privileged: false) + scopes = SCOPES + scopes += PRIVILEGED_SCOPES if privileged + scopes.collect { |s| Scope.new(s) } end end