To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / db / migrate / 099_add_delete_wiki_pages_attachments_permission.rb @ 443:350acce374a2
History | View | Annotate | Download (339 Bytes)
| 1 |
class AddDeleteWikiPagesAttachmentsPermission < ActiveRecord::Migration |
|---|---|
| 2 |
def self.up |
| 3 |
Role.find(:all).each do |r| |
| 4 |
r.add_permission!(:delete_wiki_pages_attachments) if r.has_permission?(:edit_wiki_pages) |
| 5 |
end
|
| 6 |
end
|
| 7 |
|
| 8 |
def self.down |
| 9 |
Role.find(:all).each do |r| |
| 10 |
r.remove_permission!(:delete_wiki_pages_attachments)
|
| 11 |
end
|
| 12 |
end
|
| 13 |
end
|