summaryrefslogtreecommitdiffstats
path: root/app/controllers/search_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-26 20:41:12 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-26 20:41:12 +0000
commite7c0e16a3ff68681cb475fa382d843c0977a7c09 (patch)
tree0054114634a6b4e2dd3cc1aaf39a7c8e88a95c50 /app/controllers/search_controller.rb
parent339a6212effb4ac1a9e17ff3059c67439a957928 (diff)
downloadredmine-e7c0e16a3ff68681cb475fa382d843c0977a7c09.tar.gz
redmine-e7c0e16a3ff68681cb475fa382d843c0977a7c09.zip
Use regular #authorize method.
git-svn-id: http://svn.redmine.org/redmine/trunk@16724 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb11
1 files changed, 1 insertions, 10 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index 36bae860a..2887db9a3 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class SearchController < ApplicationController
- before_action :find_optional_project
+ before_action :find_optional_project_by_id, :authorize_global
accept_api_auth :index
def index
@@ -87,13 +87,4 @@ class SearchController < ApplicationController
format.api { @results ||= []; render :layout => false }
end
end
-
-private
- def find_optional_project
- return true unless params[:id]
- @project = Project.find(params[:id])
- check_project_privacy
- rescue ActiveRecord::RecordNotFound
- render_404
- end
end