From 2664693ae83b841aa8d0e7b2bf14da751dc1ce28 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 30 Jan 2012 18:50:04 +0000 Subject: [PATCH] Removed useless permission check in wiki controller. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8735 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/wiki_controller.rb | 5 ----- test/functional/wiki_controller_test.rb | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index aaf593e2b..079c44ff3 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -241,11 +241,6 @@ class WikiController < ApplicationController # Export wiki to a single pdf or html file def export - unless User.current.allowed_to?(:export_wiki_pages, @project) - redirect_to :action => 'show', :project_id => @project, :id => nil - return - end - @pages = @wiki.pages.all(:order => 'title', :include => [:content, :attachments], :limit => 75) respond_to do |format| format.html { diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 59b1a4319..2b3cc37fb 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -644,10 +644,12 @@ class WikiControllerTest < ActionController::TestCase assert @response.body.starts_with?('%PDF') end - def test_export_without_permission_should_redirect + def test_export_without_permission_should_be_denied + @request.session[:user_id] = 2 + Role.find_by_name('Manager').remove_permission! :export_wiki_pages get :export, :project_id => 'ecookbook' - assert_response 302 + assert_response 403 end def test_date_index -- 2.39.5