view db/migrate/097_add_view_wiki_edits_permission.rb @ 1600:ed9c467ef922 dockerise

Add hggit extension
author Chris Cannam
date Wed, 23 Aug 2017 11:32:50 +0100
parents 261b3d9a4903
children
line wrap: on
line source
class AddViewWikiEditsPermission < ActiveRecord::Migration
  def self.up
    Role.all.each do |r|
      r.add_permission!(:view_wiki_edits) if r.has_permission?(:view_wiki_pages)
    end
  end

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