Fix bug with downgrade permissions on first project assigment to team

This commit is contained in:
Andrey Kumanyaev 2013-03-18 15:44:26 +04:00
parent aa5327a565
commit a0f2fbc250

View file

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