diff options
author | Andrey Kumanyaev <me@zzet.org> | 2013-03-18 15:44:26 +0400 |
---|---|---|
committer | Andrey Kumanyaev <me@zzet.org> | 2013-03-18 15:44:26 +0400 |
commit | a0f2fbc25094066995aefe7c3ad6b0f0de8e5fe3 (patch) | |
tree | 0b9814e86acb6722c0fa8ff4fa692471aa843d1e /lib | |
parent | aa5327a565c4f528760520031089f2a1a68d7535 (diff) | |
download | gitlab-ce-a0f2fbc25094066995aefe7c3ad6b0f0de8e5fe3.tar.gz |
Fix bug with downgrade permissions on first project assigment to team
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/user_team_manager.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/gitlab/user_team_manager.rb b/lib/gitlab/user_team_manager.rb index a8ff4a3d94d..e7b9756304b 100644 --- a/lib/gitlab/user_team_manager.rb +++ b/lib/gitlab/user_team_manager.rb @@ -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| |