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 / 016_add_repositories_permissions.rb @ 1298:4f746d8966dd
History | View | Annotate | Download (1.51 KB)
| 1 | 0:513646585e45 | Chris | class AddRepositoriesPermissions < ActiveRecord::Migration |
|---|---|---|---|
| 2 | # model removed
|
||
| 3 | class Permission < ActiveRecord::Base; end |
||
| 4 | |||
| 5 | def self.up |
||
| 6 | Permission.create :controller => "repositories", :action => "show", :description => "button_view", :sort => 1450, :is_public => true |
||
| 7 | Permission.create :controller => "repositories", :action => "browse", :description => "label_browse", :sort => 1460, :is_public => true |
||
| 8 | Permission.create :controller => "repositories", :action => "entry", :description => "entry", :sort => 1462, :is_public => true |
||
| 9 | Permission.create :controller => "repositories", :action => "revisions", :description => "label_view_revisions", :sort => 1470, :is_public => true |
||
| 10 | Permission.create :controller => "repositories", :action => "revision", :description => "label_view_revisions", :sort => 1472, :is_public => true |
||
| 11 | Permission.create :controller => "repositories", :action => "diff", :description => "diff", :sort => 1480, :is_public => true |
||
| 12 | end
|
||
| 13 | |||
| 14 | def self.down |
||
| 15 | 1295:622f24f53b42 | Chris | Permission.where("controller=? and action=?", 'repositories', 'show').first.destroy |
| 16 | Permission.where("controller=? and action=?", 'repositories', 'browse').first.destroy |
||
| 17 | Permission.where("controller=? and action=?", 'repositories', 'entry').first.destroy |
||
| 18 | Permission.where("controller=? and action=?", 'repositories', 'revisions').first.destroy |
||
| 19 | Permission.where("controller=? and action=?", 'repositories', 'revision').first.destroy |
||
| 20 | Permission.where("controller=? and action=?", 'repositories', 'diff').first.destroy |
||
| 21 | 0:513646585e45 | Chris | end
|
| 22 | end |