From 8e6da0d0f2f65219ffa3ba9e2a8a316b941b098d Mon Sep 17 00:00:00 2001 From: Rajmund Csehil Date: Mon, 24 Apr 2023 17:36:57 +0200 Subject: [PATCH] Add ability to set user and context in rce_js_env_base This improves reusability of the method. fixes QUIZ-11132 flag=none test plan: - add a binding.pry line in WikiPagesController - try to edit a page in a course, this gives you pry - ensure rce_js_env_base is callable with and without params Change-Id: If6ca548dac3c51fb724c168a2c0e000b2bf44af3 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316756 Tested-by: Service Cloud Jenkins Reviewed-by: Roland Beres QA-Review: Roland Beres Product-Review: Roland Beres --- app/controllers/application_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e338c07a319..91238199c61 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -392,12 +392,12 @@ class ApplicationController < ActionController::Base helper_method :render_js_env # add keys to JS environment necessary for the RCE at the given risk level - def rce_js_env_base(domain: request.host_with_port) + def rce_js_env_base(domain: request.host_with_port, user: @current_user, context: @context) Services::RichContent.env_for( - user: @current_user, + user: user, domain: domain, real_user: @real_current_user, - context: @context + context: context ) end