Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
d285dbb87c2b
Commit
f6cc71bc
authored
Feb 15, 2013
by
Dmitriy Zaporozhets
Browse files
Per project protection
parent
db6b9254e22c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/controllers/files_controller.rb
View file @
d285dbb8
class
FilesController
<
ApplicationController
def
download
uploader
=
Note
.
find
(
params
[
:id
]).
attachment
send_file
uploader
.
file
.
path
,
disposition:
'attachment'
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment