Fix permission helpers in delayed export job [SCI-2834]

This commit is contained in:
Oleksii Kriuchykhin 2018-10-30 14:04:01 +01:00
parent 2b4ef619c2
commit daaeb385bb

View file

@ -225,6 +225,7 @@ class Project < ApplicationRecord
def generate_report_pdf(user, team, pdf_name, obj_filenames = nil) def generate_report_pdf(user, team, pdf_name, obj_filenames = nil)
ActionController::Renderer::RACK_KEY_TRANSLATION['warden'] ||= 'warden' ActionController::Renderer::RACK_KEY_TRANSLATION['warden'] ||= 'warden'
proxy = Warden::Proxy.new({}, Warden::Manager.new({})) proxy = Warden::Proxy.new({}, Warden::Manager.new({}))
proxy.set_user(user, scope: :user, store: false)
renderer = ApplicationController.renderer.new(warden: proxy) renderer = ApplicationController.renderer.new(warden: proxy)
report = Report.generate_whole_project_report(self, user, team) report = Report.generate_whole_project_report(self, user, team)