]> git.openstreetmap.org Git - rails.git/commitdiff
Externalize message about missing OAuth capabilities/permissions and make it less...
authorSimon Poole <simon@poole.ch>
Sun, 26 Feb 2017 20:43:43 +0000 (21:43 +0100)
committerSimon Poole <simon@poole.ch>
Sun, 26 Feb 2017 20:43:43 +0000 (21:43 +0100)
app/controllers/application_controller.rb
config/locales/en.yml

index 8eb5f240906579f6fdb21fff01a293fc8c0483ea..15d7781d8d1a6514e316fa6edcf63afb4b7c73e0 100644 (file)
@@ -61,7 +61,8 @@ class ApplicationController < ActionController::Base
     # method, otherwise an OAuth token was used, which has to be checked.
     unless current_token.nil?
       unless current_token.read_attribute(cap)
-        report_error "OAuth token doesn't have that capability.", :forbidden
+        set_locale
+        report_error t("oauth.permissions.missing"), :forbidden
         false
       end
     end
index 3afa7e805600df14b8c1937c0dfd504f11afea54..c709726ac7adc432090552cd1f97f5360fffbc36 100644 (file)
@@ -1651,6 +1651,8 @@ en:
       invalid: "The authorization token is not valid."
     revoke:
       flash: "You've revoked the token for %{application}"
+    permissions:
+      missing: "You have not permitted the application access to this facility"
   oauth_clients:
     new:
       title: "Register a new application"