2013-02-11 20:31:19 +01:00
|
|
|
class FilesController < ApplicationController
|
|
|
|
def download
|
2013-02-15 08:51:21 +01:00
|
|
|
note = Note.find(params[:id])
|
|
|
|
|
|
|
|
if can?(current_user, :read_project, note.project)
|
|
|
|
uploader = note.attachment
|
|
|
|
send_file uploader.file.path, disposition: 'attachment'
|
|
|
|
else
|
|
|
|
not_found!
|
|
|
|
end
|
2013-02-11 20:31:19 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|