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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user