summaryrefslogtreecommitdiff
path: root/app/controllers/files_controller.rb
blob: 3cd2e77322c318d954547092c40e37d6335bd349 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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