From: Simon Poole Date: Sun, 26 Feb 2017 20:43:43 +0000 (+0100) Subject: Externalize message about missing OAuth capabilities/permissions and make it less... X-Git-Tag: live~3537^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/12013f60a01b10656e1ddfc0937be48157108916?hp=-c Externalize message about missing OAuth capabilities/permissions and make it less technical --- 12013f60a01b10656e1ddfc0937be48157108916 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8eb5f2409..15d7781d8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 3afa7e805..c709726ac 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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"