]> git.openstreetmap.org Git - rails.git/blob - lib/oauth.rb
Add support for OAuth2 using doorkeeper
[rails.git] / lib / oauth.rb
1 module Oauth
2   SCOPES = %w[read_prefs write_prefs write_diary write_api read_gpx write_gpx write_notes].freeze
3
4   class Scope
5     attr_reader :name
6
7     def initialize(name)
8       @name = name
9     end
10
11     def description
12       I18n.t("oauth.scopes.#{name}")
13     end
14   end
15
16   def self.scopes
17     SCOPES.collect { |s| Scope.new(s) }
18   end
19 end