view db/migrate/099_add_delete_wiki_pages_attachments_permission.rb @ 929:5f33065ddc4b redmine-1.3

Update to Redmine SVN rev 9414 on 1.3-stable branch
author Chris Cannam
date Wed, 27 Jun 2012 14:54:18 +0100
parents cbb26bc654de
children 622f24f53b42
line wrap: on
line source
class AddDeleteWikiPagesAttachmentsPermission < ActiveRecord::Migration
  def self.up
    Role.find(:all).each do |r|
      r.add_permission!(:delete_wiki_pages_attachments) if r.has_permission?(:edit_wiki_pages)
    end
  end

  def self.down
    Role.find(:all).each do |r|
      r.remove_permission!(:delete_wiki_pages_attachments)
    end
  end
end