Skip to content
Snippets Groups Projects
Commit 74594891 authored by alex pooley's avatar alex pooley
Browse files

Ensure levels is an array

Changelog: fixed
parent e5c34c00
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -224,7 +224,9 @@ def of_ancestors_and_self
scope :excluding_restricted_visibility_levels_for_user, ->(user) do
return all if user.can_admin_all_resources?
 
case Gitlab::CurrentSettings.restricted_visibility_levels.sort
levels = Array.wrap(Gitlab::CurrentSettings.restricted_visibility_levels).sort
case levels
when [Gitlab::VisibilityLevel::PRIVATE, Gitlab::VisibilityLevel::PUBLIC],
[Gitlab::VisibilityLevel::PRIVATE]
where.not(visibility_level: Gitlab::VisibilityLevel::PRIVATE)
Loading
Loading
Loading
Loading
@@ -1194,6 +1194,7 @@
using RSpec::Parameterized::TableSyntax
 
where(:restricted_visibility_levels, :expected_groups) do
nil | lazy { [private_group, internal_group, group] }
[] | lazy { [private_group, internal_group, group] }
[private_vis] | lazy { [internal_group, group] }
[internal_vis] | lazy { [private_group, internal_group, group] }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment