view .svn/pristine/a3/a364456950eb9dddb03948fc2af9610fa32b4fac.svn-base @ 1539:22d57b0e0a77 live

OK, this script works now, but it should be using the API
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 21 May 2015 17:31:06 +0100
parents 261b3d9a4903
children
line wrap: on
line source
class AddDeleteWikiPagesAttachmentsPermission < ActiveRecord::Migration
  def self.up
    Role.all.each do |r|
      r.add_permission!(:delete_wiki_pages_attachments) if r.has_permission?(:edit_wiki_pages)
    end
  end

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