Commit 5f3df89c64f9b93ce9b8f6a791c6d6d51fd18624
1 parent
74e32906
Exists in
master
and in
4 other branches
Fix teams + gitolite access
Showing
1 changed file
with
3 additions
and
5 deletions
Show diff stats
lib/gitlab/user_team_manager.rb
@@ -79,12 +79,10 @@ module Gitlab | @@ -79,12 +79,10 @@ module Gitlab | ||
79 | granted_access = max_teams_member_permission_in_project(user, project) | 79 | granted_access = max_teams_member_permission_in_project(user, project) |
80 | 80 | ||
81 | project_team_user = UsersProject.find_by_user_id_and_project_id(user.id, project.id) | 81 | project_team_user = UsersProject.find_by_user_id_and_project_id(user.id, project.id) |
82 | + project_team_user.destroy if project_team_user.present? | ||
82 | 83 | ||
83 | - if project_team_user.present? | ||
84 | - project_team_user.destroy | ||
85 | - end | ||
86 | - | ||
87 | - if project_team_user.blank? && granted_access > 0 | 84 | + # project_team_user.project_access != granted_access |
85 | + if granted_access > 0 | ||
88 | UsersProject.add_users_into_projects([project.id], [user.id], granted_access) | 86 | UsersProject.add_users_into_projects([project.id], [user.id], granted_access) |
89 | end | 87 | end |
90 | end | 88 | end |