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 @ 443:350acce374a2
History | View | Annotate | Download (1.62 KB)
| 1 |
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 |
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'show']).destroy |
| 16 |
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'browse']).destroy |
| 17 |
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'entry']).destroy |
| 18 |
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'revisions']).destroy |
| 19 |
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'revision']).destroy |
| 20 |
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'diff']).destroy |
| 21 |
end
|
| 22 |
end
|