repo & project access separated. critical gitolite bugfix
This commit is contained in:
parent
2ca00bdb3e
commit
cb021e5831
12 changed files with 106 additions and 48 deletions
20
db/migrate/20111206222316_migrate_to_new_rights.rb
Normal file
20
db/migrate/20111206222316_migrate_to_new_rights.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
class MigrateToNewRights < ActiveRecord::Migration
|
||||
def up
|
||||
# Repository access
|
||||
UsersProject.update_all("repo_access = 2", :write => true)
|
||||
UsersProject.update_all("repo_access = 1", :read => true, :write => false)
|
||||
|
||||
# Project access
|
||||
UsersProject.update_all("project_access = 1", :read => true, :write => false, :admin => false)
|
||||
UsersProject.update_all("project_access = 2", :read => true, :write => true, :admin => false)
|
||||
UsersProject.update_all("project_access = 3", :read => true, :write => true, :admin => true)
|
||||
|
||||
# Remove old fields
|
||||
remove_column :users_projects, :read
|
||||
remove_column :users_projects, :write
|
||||
remove_column :users_projects, :admin
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue