diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2011-12-07 03:27:07 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2011-12-07 03:27:07 +0400 |
commit | cb021e58314791c1c9eb8035ed01349876d246a1 (patch) | |
tree | 3bebdf541af2967e2d5096f3c5c60ac24dd03240 /lib | |
parent | 2ca00bdb3e07e84a87c6d480d8cb896bf6f08ca9 (diff) |
repo & project access separated. critical gitolite bugfix
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlabhq/gitolite.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/gitlabhq/gitolite.rb b/lib/gitlabhq/gitolite.rb index de8241fe13a..10ab87bdaf8 100644 --- a/lib/gitlabhq/gitolite.rb +++ b/lib/gitlabhq/gitolite.rb @@ -61,7 +61,7 @@ module Gitlabhq end # update or create - def update_project(repo_name, name_writers) + def update_project(repo_name, project) ga_repo = ::Gitolite::GitoliteAdmin.new(File.join(@local_dir,'gitolite')) conf = ga_repo.config @@ -71,8 +71,13 @@ module Gitlabhq ::Gitolite::Config::Repo.new(repo_name) end + name_readers = project.repository_readers + name_writers = project.repository_writers + + repo.clean_permissions + repo.add_permission("R", "", name_readers) unless name_readers.blank? repo.add_permission("RW+", "", name_writers) unless name_writers.blank? - conf.add_repo(repo) + conf.add_repo(repo, true) ga_repo.save end |