summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-06-22 08:35:49 +0200
committerToon Claes <toon@gitlab.com>2017-06-23 11:15:35 +0200
commitb90f1098cf42889c32eb6f12779def005f15cbae (patch)
treeb36866422e1948909f5be1f26a91a84a2c3b6fbc /app/finders
parentf09aa6b755043e9bba1eb7ae8f1ae45adc5df136 (diff)
downloadgitlab-ce-b90f1098cf42889c32eb6f12779def005f15cbae.tar.gz
Add User#full_private_access? to check if user has Private accesstc-refactor-projects-finder-init-collection
In CE only the admin has access to all private groups & projects. In EE also an auditor can have full private access. To overcome merge conflicts, or accidental incorrect access rights, abstract this out in `User#full_private_access?`. `User#admin?` now only should be used for admin-only features. For private access-related features `User#full_private_access?` should be used. Backported from gitlab-org/gitlab-ee!2199
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issues_finder.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb
index b4c074bc69c..3da5508aefd 100644
--- a/app/finders/issues_finder.rb
+++ b/app/finders/issues_finder.rb
@@ -41,7 +41,7 @@ class IssuesFinder < IssuableFinder
def self.not_restricted_by_confidentiality(user)
return Issue.where('issues.confidential IS NOT TRUE') if user.blank?
- return Issue.all if user.admin?
+ return Issue.all if user.full_private_access?
Issue.where('
issues.confidential IS NOT TRUE