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:
authorFelipe Artur <felipefac@gmail.com>2016-03-09 03:01:33 +0300
committerFelipe Artur <felipefac@gmail.com>2016-03-10 16:38:36 +0300
commitc3e70280dffe7ee0859ebd73b902d424ca5f809a (patch)
tree06b83a5ab13d19803332253cf50a941501b29317 /lib/gitlab/visibility_level.rb
parentbd59e59d01c5e845c7f7d451feaa1488670f20de (diff)
Prevent projects to have higher visibility than groups
Prevent Groups to have smaller visibility than projects Add default_group_visibility_level to configuration Code improvements
Diffstat (limited to 'lib/gitlab/visibility_level.rb')
-rw-r--r--lib/gitlab/visibility_level.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index 3160a3c7582..f6e0dd6afc0 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -12,6 +12,13 @@ module Gitlab
PUBLIC = 20 unless const_defined?(:PUBLIC)
class << self
+ def included(base)
+ base.class_eval do
+ scope :public_only, -> { where(visibility_level: PUBLIC) }
+ scope :public_and_internal_only, -> { where(visibility_level: [PUBLIC, INTERNAL] ) }
+ end
+ end
+
def values
options.values
end