X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/f58f49e196da9a063c8c7e61b158e06a2df0315d..e222329d043592af299eed12cf6ad16969c1b46f:/lib/oauth.rb diff --git a/lib/oauth.rb b/lib/oauth.rb new file mode 100644 index 000000000..8f45a3b4b --- /dev/null +++ b/lib/oauth.rb @@ -0,0 +1,19 @@ +module Oauth + SCOPES = %w[read_prefs write_prefs write_diary write_api read_gpx write_gpx write_notes].freeze + + class Scope + attr_reader :name + + def initialize(name) + @name = name + end + + def description + I18n.t("oauth.scopes.#{name}") + end + end + + def self.scopes + SCOPES.collect { |s| Scope.new(s) } + end +end