+ def better_errors_allow_inline
+ yield
+ rescue StandardError
+ append_content_security_policy_directives(
+ :script_src => %w['unsafe-inline'],
+ :style_src => %w['unsafe-inline']
+ )
+
+ raise
+ end
+
+ def current_ability
+ Ability.new(current_user, current_token)
+ end
+
+ def deny_access(exception)
+ if current_user
+ set_locale
+ report_error t("oauth.permissions.missing"), :forbidden
+ else
+ require_user
+ end
+ end
+