Add an ACL check to allow trace downloads to be blocked
This commit is contained in:
parent
0465fda75a
commit
8ba74c581d
1 changed files with 3 additions and 1 deletions
|
@ -163,7 +163,9 @@ class TraceController < ApplicationController
|
|||
trace = Trace.find(params[:id])
|
||||
|
||||
if trace.visible? and (trace.public? or (@user and @user == trace.user))
|
||||
if request.format == Mime::XML
|
||||
if Acl.address(request.remote_ip).where(:k => "no_trace_download").exists?
|
||||
render :nothing => true, :status => :forbidden
|
||||
elsif request.format == Mime::XML
|
||||
send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => Mime::XML.to_s, :disposition => 'attachment')
|
||||
else
|
||||
send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue