summaryrefslogtreecommitdiff
path: root/lib/gitlab/visibility_level.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/visibility_level.rb')
-rw-r--r--lib/gitlab/visibility_level.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index 1851e76067c..582fc759efd 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -35,7 +35,13 @@ module Gitlab
end
def non_restricted_level?(level)
- ! current_application_settings.restricted_visibility_levels.include?(level)
+ restricted_levels = current_application_settings.restricted_visibility_levels
+
+ if restricted_levels.nil?
+ true
+ else
+ !restricted_levels.include?(level)
+ end
end
def valid_level?(level)