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 <svc.cloudjenkins@instructure.com>
Reviewed-by: Roland Beres <roland.beres@instructure.com>
QA-Review: Roland Beres <roland.beres@instructure.com>
Product-Review: Roland Beres <roland.beres@instructure.com>
This commit is contained in:
Rajmund Csehil 2023-04-24 17:36:57 +02:00 committed by Roland Beres
parent 29b3d6791d
commit 8e6da0d0f2
1 changed files with 3 additions and 3 deletions

View File

@ -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