Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-01-20 14:25:53 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2017-01-20 14:25:53 +0300
commitb7f4553e3e4681d5a4a53af35650bcbb1c83b390 (patch)
tree281f19e15f9c06e978382fbaffb42ddb1ad705eb /lib/gitlab/visibility_level.rb
parent491f1375fc055805c623a3079a383de988689f3d (diff)
Backport changes introduced by https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1083
Diffstat (limited to 'lib/gitlab/visibility_level.rb')
-rw-r--r--lib/gitlab/visibility_level.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index 9462f3368e6..c7953af29dd 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -11,6 +11,7 @@ module Gitlab
included do
scope :public_only, -> { where(visibility_level: PUBLIC) }
scope :public_and_internal_only, -> { where(visibility_level: [PUBLIC, INTERNAL] ) }
+ scope :non_public_only, -> { where.not(visibility_level: PUBLIC) }
scope :public_to_user, -> (user) { user && !user.external ? public_and_internal_only : public_only }
end