You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

016_add_repositories_permissions.rb 1.5KB

12345678910111213141516171819202122
  1. class AddRepositoriesPermissions < ActiveRecord::Migration[4.2]
  2. # model removed
  3. class Permission < ActiveRecord::Base; end
  4. def self.up
  5. Permission.create :controller => "repositories", :action => "show", :description => "button_view", :sort => 1450, :is_public => true
  6. Permission.create :controller => "repositories", :action => "browse", :description => "label_browse", :sort => 1460, :is_public => true
  7. Permission.create :controller => "repositories", :action => "entry", :description => "entry", :sort => 1462, :is_public => true
  8. Permission.create :controller => "repositories", :action => "revisions", :description => "label_view_revisions", :sort => 1470, :is_public => true
  9. Permission.create :controller => "repositories", :action => "revision", :description => "label_view_revisions", :sort => 1472, :is_public => true
  10. Permission.create :controller => "repositories", :action => "diff", :description => "diff", :sort => 1480, :is_public => true
  11. end
  12. def self.down
  13. Permission.where("controller=? and action=?", 'repositories', 'show').first.destroy
  14. Permission.where("controller=? and action=?", 'repositories', 'browse').first.destroy
  15. Permission.where("controller=? and action=?", 'repositories', 'entry').first.destroy
  16. Permission.where("controller=? and action=?", 'repositories', 'revisions').first.destroy
  17. Permission.where("controller=? and action=?", 'repositories', 'revision').first.destroy
  18. Permission.where("controller=? and action=?", 'repositories', 'diff').first.destroy
  19. end
  20. end