diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-05-25 16:44:50 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-05-25 16:44:50 +0000 |
commit | 6446c312beab7e23162827a79bd9ab6f9e4d7958 (patch) | |
tree | 4ea3f9dc23b786f77e803ce63d76e62f1f57d81e /app/controllers | |
parent | 4a524ff911edefeae8753669bb27000486741fbb (diff) | |
download | redmine-6446c312beab7e23162827a79bd9ab6f9e4d7958.tar.gz redmine-6446c312beab7e23162827a79bd9ab6f9e4d7958.zip |
Added the ability to destroy wiki pages (content and its history are deleted from the database).
This permission has to be explicitly given (Roles & Permissions -> Wiki pages/Delete).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@540 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/wiki_controller.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 9e750b3a6..f68b71ecc 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -18,7 +18,10 @@ class WikiController < ApplicationController layout 'base' before_filter :find_wiki, :check_project_privacy, :except => [:preview] - + before_filter :authorize, :only => :destroy + + verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :index } + # display a page (in editing mode if it doesn't exist) def index page_title = params[:page] @@ -72,6 +75,13 @@ class WikiController < ApplicationController :select => "id, author_id, comments, updated_on, version", :order => 'version DESC' end + + # remove a wiki page and its history + def destroy + @page = @wiki.find_page(params[:page]) + @page.destroy if @page + redirect_to :action => 'special', :id => @project, :page => 'Page_index' + end # display special pages def special |