summaryrefslogtreecommitdiffstats
path: root/db/migrate/097_add_view_wiki_edits_permission.rb
blob: e26644fbaa9d80f3050d7346e9c6baa376fa1183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: false

class AddViewWikiEditsPermission < ActiveRecord::Migration[4.2]
  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