Hide restricted access configuration on contract overages allowed false

What does this MR do and why?

We want to hide the restricted access configuration for Self-Managed and GitLab.com, in case the attribute contract_overages_allowed is set to false

References

Screenshots or screen recordings

Deployment Type URL Before After
GitLab.com http://gdk.test:8080/groups/15026/-/edit#js-permissions-settings image.png image.png
Self-Managed http://gdk.test:8080/admin/application_settings/general#js-signup-settings image.png image.png

How to set up and validate locally

Apply the following patch to ensure the custom attribute is set. This will become controllable once this merge request here is merged.

Patch
diff --git a/ee/app/helpers/ee/application_settings_helper.rb b/ee/app/helpers/ee/application_settings_helper.rb
index 963ac6f65f0a..dc93f282ceb7 100644
--- a/ee/app/helpers/ee/application_settings_helper.rb
+++ b/ee/app/helpers/ee/application_settings_helper.rb
@@ -262,7 +262,7 @@ def signup_form_data
       seat_control = License.feature_available?(:seat_control) ? @application_setting[:seat_control] : ''
       form_data[:seat_control] = seat_control.to_s
 
-      form_data[:contract_overages_allowed] = License.current ? License.current.contract_overages_allowed.to_s : 'true'
+      form_data[:contract_overages_allowed] = 'false'
 
       form_data[:ldap_sync_configured] = bso_provisioning_warning?(::Gitlab::Auth::Ldap::Config).to_s
       form_data[:saml_scim_configured] = bso_provisioning_warning?(::Gitlab::Auth::Saml::Config).to_s
diff --git a/ee/app/views/groups/_seat_control_setting.html.haml b/ee/app/views/groups/_seat_control_setting.html.haml
index 11e33bba7ed4..52d868216a01 100644
--- a/ee/app/views/groups/_seat_control_setting.html.haml
+++ b/ee/app/views/groups/_seat_control_setting.html.haml
@@ -3,7 +3,7 @@
 .form-group#js-seat-control
   %h5
     = _("Seat control")
-  - if group.gitlab_subscription&.contract_overages_allowed? == false
+  - if true
     .gl-flex.gl-items-start.gl-gap-3
       = sprite_icon('lock', css_class: 'gl-mt-1 gl-flex-shrink-0 gl-text-gray-500')
       %p.gl-mb-0

GitLab.com

  1. Start your GitLab instance in SaaS mode export GITLAB_SIMULATE_SAAS=1; gdk restart
  2. Get a subscription for a top-level group
  3. Check that http://gdk.test:8080/groups/15026/-/edit#js-permissions-settings hides the Restricted Access controls

Self-Managed

  1. Start your GitLab instance in Self-Managed mode export GITLAB_SIMULATE_SAAS=0; gdk restart
  2. Get and enable a license for your instance
  3. Check that http://gdk.test:8080/admin/application_settings/general#js-signup-settings hides the controls
Edited by Lukas Wanko

Merge request reports

Loading
Loading