Fix bug with downgrade permissions on first project assigment to team

5-0-stable
Andrey Kumanyaev 2013-03-18 15:44:26 +04:00
parent aa5327a565
commit a0f2fbc250
1 changed files with 2 additions and 3 deletions

View File

@ -88,9 +88,8 @@ module Gitlab
def max_teams_member_permission_in_project(user, project, teams = nil)
result_access = 0
user_teams = project.user_teams.with_member(user)
teams ||= user_teams
teams ||= project.user_teams.with_member(user)
result_access ||= project.users_project.with_user(user).first.project_access
if teams.any?
teams.each do |team|