From 12013f60a01b10656e1ddfc0937be48157108916 Mon Sep 17 00:00:00 2001 From: Simon Poole Date: Sun, 26 Feb 2017 21:43:43 +0100 Subject: [PATCH] Externalize message about missing OAuth capabilities/permissions and make it less technical --- app/controllers/application_controller.rb | 3 ++- config/locales/en.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) 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" -- 2.39.5