Revert !110566 due to bug
What does this MR do and why?
Reverts !110566 (merged)
When I was verifying the related issues for !110566 (merged) I noticed a bug. The bug is:
- Create a public group
- Invite a user as an owner to the public group
- Go to the admin area ->
Settings
->General
->Visibility and access controls
- In the
Restricted visibility levels
setting check onlyPrivate
. Save the form. - Go to the admin area ->
Users
- Find the user you invited in step 2
- Click
Impersonate
- Navigate to the group you created in step 1
- The
New project
button should be shown but it is not
Also to verify this bug you can add this to line 504
of spec/features/groups_spec.rb#L504
stub_application_setting(
restricted_visibility_levels: [
Gitlab::VisibilityLevel::PRIVATE
]
)
I thought I checked this but apparently I missed something. Looking at the code now, I think this makes sense. The code in !110566 (merged) was based off of app/services/projects/create_service.rb#L46 but I think what was missed is this checks if the restricted visibility level matches the @project.visiblity_level
in app/services/concerns/base_service_utility.rb#L37
Luckily, this shouldn't affect gitlab.com since the Restricted visibility levels
Admin setting shouldn't be set on gitlab.com.
Screenshots or screen recordings
With this setting in admin area:
New project
button should be shown in a public group but it isn't
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.