X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f4d1d97848306e71b6525c58f2e5691b8aa686b7..f1fc31d485eb310781600645df43b3f45a76fd57:/lib/oauth.rb diff --git a/lib/oauth.rb b/lib/oauth.rb index 07e54d858..88db38eb4 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[read_email].freeze + PRIVILEGED_SCOPES = %w[read_email skip_authorization].freeze + MODERATOR_SCOPES = %w[write_redactions].freeze + OAUTH2_SCOPES = %w[write_redactions 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