Commit 5f3df89c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix teams + gitolite access

parent 74e32906
...@@ -79,12 +79,10 @@ module Gitlab ...@@ -79,12 +79,10 @@ module Gitlab
granted_access = max_teams_member_permission_in_project(user, project) granted_access = max_teams_member_permission_in_project(user, project)
project_team_user = UsersProject.find_by_user_id_and_project_id(user.id, project.id) project_team_user = UsersProject.find_by_user_id_and_project_id(user.id, project.id)
project_team_user.destroy if project_team_user.present?
if project_team_user.present? # project_team_user.project_access != granted_access
project_team_user.destroy if granted_access > 0
end
if project_team_user.blank? && granted_access > 0
UsersProject.add_users_into_projects([project.id], [user.id], granted_access) UsersProject.add_users_into_projects([project.id], [user.id], granted_access)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment