Remove confidential access checks if user has group access

We simplify the query generated if the user can see all confidential issues in a
project context. This change applies the same simplification to group issue
lists.
This commit is contained in:
Sean McGivern 2018-09-05 12:05:19 +01:00
parent b480d7121f
commit 803671cc53
1 changed files with 7 additions and 3 deletions

View File

@ -120,9 +120,13 @@ class IssuesFinder < IssuableFinder
return @user_can_see_all_confidential_issues = true if current_user.full_private_access?
@user_can_see_all_confidential_issues =
project? &&
project &&
project.team.max_member_access(current_user.id) >= CONFIDENTIAL_ACCESS_LEVEL
if project? && project
project.team.max_member_access(current_user.id) >= CONFIDENTIAL_ACCESS_LEVEL
elsif group
group.max_member_access_for_user(current_user) >= CONFIDENTIAL_ACCESS_LEVEL
else
false
end
end
def user_cannot_see_confidential_issues?