099_add_delete_wiki_pages_attachments_permission.rb 344 Bytes
Newer Older
1
class AddDeleteWikiPagesAttachmentsPermission < ActiveRecord::Migration[4.2]
2
  def self.up
jplang's avatar
jplang committed
3
    Role.all.each do |r|
4 5
      r.add_permission!(:delete_wiki_pages_attachments) if r.has_permission?(:edit_wiki_pages)
    end
6 7 8
  end

  def self.down
jplang's avatar
jplang committed
9
    Role.all.each do |r|
10 11
      r.remove_permission!(:delete_wiki_pages_attachments)
    end
12 13
  end
end