repo & project access separated. critical gitolite bugfix

This commit is contained in:
Dmitriy Zaporozhets 2011-12-07 01:27:07 +02:00
parent 2ca00bdb3e
commit cb021e5831
12 changed files with 106 additions and 48 deletions

View 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