diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-04 13:03:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-04 13:03:30 +0300 |
commit | d35df0ad158c14cb28f583f4b26c4196ef23a3f7 (patch) | |
tree | 5a1992758772519104eacb5de2c231721876541c /lib/gitlab | |
parent | 3c51da6f5782e53123a7ed5af98ba0828cbfa49f (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/visibility_level.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb index 082d93aa354..a22740ab9b7 100644 --- a/lib/gitlab/visibility_level.rb +++ b/lib/gitlab/visibility_level.rb @@ -82,15 +82,23 @@ module Gitlab end def non_restricted_level?(level) + !restricted_level?(level) + end + + def restricted_level?(level) restricted_levels = Gitlab::CurrentSettings.restricted_visibility_levels if restricted_levels.nil? - true + false else - !restricted_levels.include?(level) + restricted_levels.include?(level) end end + def public_visibility_restricted? + restricted_level?(PUBLIC) + end + def valid_level?(level) options.value?(level) end |