099_add_delete_wiki_pages_attachments_permission.rb 353 Bytes
Newer Older
1 2
class AddDeleteWikiPagesAttachmentsPermission < ActiveRecord::Migration
  def self.up
3 4 5
    Role.find(:all).each do |r|
      r.add_permission!(:delete_wiki_pages_attachments) if r.has_permission?(:edit_wiki_pages)
    end
6 7 8
  end

  def self.down
9 10 11
    Role.find(:all).each do |r|
      r.remove_permission!(:delete_wiki_pages_attachments)
    end
12 13
  end
end