]> source.dussan.org Git - redmine.git/commitdiff
Removed useless permission check in wiki controller.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 30 Jan 2012 18:50:04 +0000 (18:50 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 30 Jan 2012 18:50:04 +0000 (18:50 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8735 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/wiki_controller.rb
test/functional/wiki_controller_test.rb

index aaf593e2b723965a0b551f25cfc1b825a23d1fcb..079c44ff3f3d659b21c1bc20d0e3c08242c00a09 100644 (file)
@@ -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 {
index 59b1a4319d6a7ab91e86a96cbc16f1ab993652e8..2b3cc37fb53e513b27bb966a1237d1e2fc122bfe 100644 (file)
@@ -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