From 31c1873cb0dd0ecba92e7b9f94cab9d34c18abef Mon Sep 17 00:00:00 2001 From: Simon Bear Date: Sat, 23 Nov 2024 19:06:22 +1100 Subject: [PATCH] Downloads require authentication --- .../au/org/ala/images/SearchController.groovy | 1 + grails-app/views/search/list.gsp | 33 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/grails-app/controllers/au/org/ala/images/SearchController.groovy b/grails-app/controllers/au/org/ala/images/SearchController.groovy index c30993ba..237e1e89 100644 --- a/grails-app/controllers/au/org/ala/images/SearchController.groovy +++ b/grails-app/controllers/au/org/ala/images/SearchController.groovy @@ -121,6 +121,7 @@ class SearchController { redirect(action:'list', params:[q:params.q, fq:params.fq]) } + @AlaSecured def download(){ response.setHeader("Content-Disposition", "attachment; filename=\"images.zip\"") response.setHeader("Content-Type", "application/zip") diff --git a/grails-app/views/search/list.gsp b/grails-app/views/search/list.gsp index b47f193b..225ec42d 100644 --- a/grails-app/views/search/list.gsp +++ b/grails-app/views/search/list.gsp @@ -32,10 +32,19 @@ - - - - + + + + + + + + + + @@ -85,6 +94,22 @@ +