aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-08-22 15:23:46 +0100
committerLouise Crow <louise.crow@gmail.com>2013-09-16 12:42:19 +0100
commitfd0c811cc4e01435ca89a419a521f6ac31a858b1 (patch)
tree477952cff8d4aec4e7ae8ca67d91f5ae0f64aeac /app/controllers/request_controller.rb
parentc954d92fe4f558a5f4375016ee6cf517d3ec5ddd (diff)
Restore the download for hidden requests
This was disabled for hidden requests as the download was by redirect, allowing people who have not been authenticated to conceivably access the download. We'll be moving to send_file instead, so can restore it.
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 0180ad840..8b978cc01 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -868,10 +868,6 @@ class RequestController < ApplicationController
@locale = self.locale_from_params()
I18n.with_locale(@locale) do
@info_request = InfoRequest.find_by_url_title!(params[:url_title])
- # Test for whole request being hidden or requester-only
- if !@info_request.all_can_view?
- return render_hidden
- end
if authenticated?(
:web => _("To download the zip file"),
:email => _("Then you can download a zip file of {{info_request_title}}.",
@@ -879,6 +875,10 @@ class RequestController < ApplicationController
:email_subject => _("Log in to download a zip file of {{info_request_title}}",
:info_request_title=>@info_request.title)
)
+ # Test for whole request being hidden or requester-only
+ if !@info_request.user_can_view?(@user)
+ return render_hidden
+ end
@url_path = File.join("/download",
request_dirs(@info_request),
@info_request.last_update_hash,