Skip to content

Revert !110566 due to bug

Peter Hegman requested to merge revert-a6eaa669 into master

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:

  1. Create a public group
  2. Invite a user as an owner to the public group
  3. Go to the admin area -> Settings -> General -> Visibility and access controls
  4. In the Restricted visibility levels setting check only Private. Save the form.
  5. Go to the admin area -> Users
  6. Find the user you invited in step 2
  7. Click Impersonate
  8. Navigate to the group you created in step 1
  9. 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:

Screenshot_2023-02-08_at_10.34.53_AM

New project button should be shown in a public group but it isn't

Screenshot_2023-02-08_at_10.34.28_AM

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Hegman

Merge request reports