view db/migrate/099_add_delete_wiki_pages_attachments_permission.rb @ 556:ca9e8e562ea7 feature_36

Addresses Bug #177: when the publication is saved the authors are saved in the order they were entered. *Attention*: need to re-migrate (and re-seed) the plugin's database!
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 03 Aug 2011 15:41:19 +0100
parents 513646585e45
children cbb26bc654de
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