Commit 50b6c661 authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'more-nil-visibility-fixes' into 'master'

Handle nil restricted visibility settings

Return `true` from `non_restricted_level?` when the `restricted_visibility_levels` setting is nil.  This addresses #2154.

cc @sytse

See merge request !1724
parents 0eaabc27 e535d217
...@@ -35,7 +35,11 @@ module Gitlab ...@@ -35,7 +35,11 @@ module Gitlab
end end
def non_restricted_level?(level) def non_restricted_level?(level)
! current_application_settings.restricted_visibility_levels.include?(level) if current_application_settings.restricted_visibility_levels.nil?
true
else
! current_application_settings.restricted_visibility_levels.include?(level)
end
end end
def valid_level?(level) def valid_level?(level)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment