2 class IconsController < ApplicationController
3 before_action :authorize_web
4 before_action :check_database_readable
6 authorize_resource :trace
9 trace = Trace.visible.find(params[:trace_id])
12 if trace.public? || (current_user && current_user == trace.user)
13 if trace.icon.attached?
14 redirect_to rails_blob_path(trace.icon, :disposition => "inline")
16 expires_in 7.days, :private => !trace.public?, :public => trace.public?
17 send_file(trace.icon_picture_name, :filename => "#{trace.id}_icon.gif", :type => "image/gif", :disposition => "inline")
25 rescue ActiveRecord::RecordNotFound