X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6c6e8883f703efe8e05d893a94c169ac90733d42..f8ed06b10dadae1a6e3942bbd29e5193437c8ea9:/lib/oauth.rb diff --git a/lib/oauth.rb b/lib/oauth.rb index 6980447f9..a8f497621 100644 --- a/lib/oauth.rb +++ b/lib/oauth.rb @@ -1,6 +1,8 @@ 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 skip_authorization].freeze + MODERATOR_SCOPES = %w[write_redactions].freeze + OAUTH2_SCOPES = %w[write_redactions consume_messages send_messages openid].freeze class Scope attr_reader :name @@ -14,9 +16,10 @@ module Oauth end end - def self.scopes(privileged: false) + def self.scopes(oauth2: false, privileged: false) scopes = SCOPES scopes += PRIVILEGED_SCOPES if privileged + scopes += OAUTH2_SCOPES if oauth2 scopes.collect { |s| Scope.new(s) } end end