修改rake 任务获取gitlab roles方法

This commit is contained in:
siteen 2016-12-14 10:22:49 +08:00
parent f82ea16102
commit 1561a1176a
1 changed files with 3 additions and 2 deletions

View File

@ -15,10 +15,11 @@ namespace :gitlab do
if gid.nil?
gid = sync_user(m.user).id
end
access_level = m.roles[0].position == 3 ? 40 : (m.roles[0].position == 4 ? 30 : 20)
# sync project's members
g.add_team_member(project.gpid, gid, get_gitlab_role(m))
g.add_team_member(project.gpid, gid, access_level)
# sync members' roles
g.edit_team_member(project.gpid, gid, get_gitlab_role(m))
g.edit_team_member(project.gpid, gid, access_level)
rescue => e
puts e
end