Add dropdown to select visibility of container registry feature
What does this MR do?
We have migrated to use ProjectFeature#container_registry_access_level
instead of Project#container_registry_enabled
for controlling the visibility of the container registry. With ProjectFeature#container_registry_access_level
, we now have the ability to set the container registry to private visibility (only available to reporter role and above) even if the project is public.
This MR adds a select dropdown under Settings > General > Visibility, project features, permissions
to allow the visibility of the Container Registry feature to be modified by project admins.
Related to #18792 (closed)
Screenshots (strongly suggested)
Before | After |
---|---|
How to setup and validate locally (strongly suggested)
- Open any project in your GDK.
- Go to Settings > General > Visibility, project features, permissions
- Toggle the Container registry switch if it is off.
- Select an option from the dropdown.
- Click "Save changes".
- If you want to verify if the setting got saved correctly, open a Rails console and run the following:
# If you selected "Everyone With Access", this value should be 20. # If you selected "Only Project Members", this value should be 10. # If you toggle the switch to disable the container registry, this value should be 0. Project.find(<your project ID>).container_registry_access_level
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- Label as security and @ mention
@gitlab-com/gl-security/appsec
- The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- Security reports checked/validated by a reviewer from the AppSec team