Admin area: add multiple users to project
This commit is contained in:
parent
f6f72d4b22
commit
fa8c0c7813
5 changed files with 69 additions and 1 deletions
|
@ -13,6 +13,20 @@ class UsersProject < ActiveRecord::Base
|
|||
|
||||
delegate :name, :email, :to => :user, :prefix => true
|
||||
|
||||
def self.bulk_import(project, user_ids, project_access, repo_access)
|
||||
UsersProject.transaction do
|
||||
user_ids.each do |user_id|
|
||||
users_project = UsersProject.new(
|
||||
:repo_access => repo_access,
|
||||
:project_access => project_access,
|
||||
:user_id => user_id
|
||||
)
|
||||
users_project.project = project
|
||||
users_project.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update_repository
|
||||
Gitlabhq::GitHost.system.new.configure do |c|
|
||||
c.update_project(project.path, project)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue