Commit a0f2fbc25094066995aefe7c3ad6b0f0de8e5fe3
1 parent
aa5327a5
Exists in
master
and in
4 other branches
Fix bug with downgrade permissions on first project assigment to team
Showing
1 changed file
with
2 additions
and
3 deletions
Show diff stats
lib/gitlab/user_team_manager.rb
... | ... | @@ -88,9 +88,8 @@ module Gitlab |
88 | 88 | def max_teams_member_permission_in_project(user, project, teams = nil) |
89 | 89 | result_access = 0 |
90 | 90 | |
91 | - user_teams = project.user_teams.with_member(user) | |
92 | - | |
93 | - teams ||= user_teams | |
91 | + teams ||= project.user_teams.with_member(user) | |
92 | + result_access ||= project.users_project.with_user(user).first.project_access | |
94 | 93 | |
95 | 94 | if teams.any? |
96 | 95 | teams.each do |team| | ... | ... |