summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-09-13 16:45:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-09-13 16:45:01 +0000
commit455abea32042a9e612b72cdf88d158fa72cb7144 (patch)
tree4c1f313ed96bcf98817840520160cea1ad86b13e /db
parentcc643ce932b2abdc56c4d1933c02806ca57ddefa (diff)
downloadredmine-455abea32042a9e612b72cdf88d158fa72cb7144.tar.gz
redmine-455abea32042a9e612b72cdf88d158fa72cb7144.zip
Adds a permission 'view wiki edits' so that wiki history can be hidden to certain users (#1154).
A migration automatically adds this permission to roles that were allowed to view wiki pages. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1815 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r--db/migrate/097_add_wiew_wiki_edits_permission.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/097_add_wiew_wiki_edits_permission.rb b/db/migrate/097_add_wiew_wiki_edits_permission.rb
new file mode 100644
index 000000000..0f87ada28
--- /dev/null
+++ b/db/migrate/097_add_wiew_wiki_edits_permission.rb
@@ -0,0 +1,13 @@
+class AddWiewWikiEditsPermission < ActiveRecord::Migration
+ def self.up
+ Role.find(:all).each do |r|
+ r.add_permission!(:view_wiki_edits) if r.has_permission?(:view_wiki_pages)
+ end
+ end
+
+ def self.down
+ Role.find(:all).each do |r|
+ r.remove_permission!(:view_wiki_edits)
+ end
+ end
+end