1 # frozen_string_literal: true
 
   4   class PicturesController < ApplicationController
 
   5     before_action :authorize_web
 
   6     before_action :check_database_readable
 
   8     authorize_resource :trace
 
  11       trace = Trace.visible.imported.find(params[:trace_id])
 
  13       if trace.public? || (current_user && current_user == trace.user)
 
  14         redirect_to rails_blob_path(trace.image, :disposition => "inline")
 
  18     rescue ActiveRecord::RecordNotFound