gitlabhq/app/controllers/files_controller.rb
2013-02-15 09:51:21 +02:00

13 lines
291 B
Ruby

class FilesController < ApplicationController
def download
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
end
end