summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-09-18 16:11:24 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2017-09-18 16:11:24 +0000
commit9b13753302df7a3e8ef86c6af3f84066bde31a21 (patch)
treec362b53b0d8dbcdb448f357f52e7f3d5389cb893 /app/models
parentcffb325ec05eefb29f8ee93e543fd75605743f55 (diff)
parent8690ca5c2857da39c8f5839b9383931ee026f559 (diff)
downloadgitlab-ce-9b13753302df7a3e8ef86c6af3f84066bde31a21.tar.gz
Merge branch 'sh-optimize-discussion-json' into 'master'
Eliminate N+1 queries in loading discussions.json endpoint Closes #37955 See merge request gitlab-org/gitlab-ce!14327
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_team.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project_team.rb b/app/models/project_team.rb
index 09049824ff7..1d35426050e 100644
--- a/app/models/project_team.rb
+++ b/app/models/project_team.rb
@@ -146,7 +146,7 @@ class ProjectTeam
def member?(user, min_access_level = Gitlab::Access::GUEST)
return false unless user
- user.authorized_project?(project, min_access_level)
+ max_member_access(user.id) >= min_access_level
end
def human_max_access(user_id)