]> git.openstreetmap.org Git - rails.git/blobdiff - lib/oauth.rb
Merge pull request #4856 from tyrasd/patch-2
[rails.git] / lib / oauth.rb
index 7ff2ba8b4358428c04814a899d5e8563be0b971b..88db38eb4bf914b8331655e134cbdf70b243c4ee 100644 (file)
@@ -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 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