Merge branch 'features/attachment_server' of /home/git/repositories/gitlab/gitlabhq
This commit is contained in:
commit
fa3cc1dd24
5 changed files with 28 additions and 2 deletions
13
app/controllers/files_controller.rb
Normal file
13
app/controllers/files_controller.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue