We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84e5e8b commit ad811b0Copy full SHA for ad811b0
app/controllers/plan_exports_controller.rb
@@ -8,6 +8,7 @@ def show
8
@plan = Plan.includes(:answers).find(params[:plan_id])
9
10
if privately_authorized? && export_params[:form].present?
11
+ skip_authorization
12
@show_coversheet = export_params[:project_details].present?
13
@show_sections_questions = export_params[:question_headings].present?
14
@show_unanswered = export_params[:unanswered_questions].present?
@@ -93,7 +94,11 @@ def publicly_authorized?
93
94
end
95
96
def privately_authorized?
- authorize @plan, :export?
97
+ if current_user.present?
98
+ PlanPolicy.new(current_user, @plan).export?
99
+ else
100
+ false
101
+ end
102
103
104
def export_params
0 commit comments