Skip to content

Prevent enabling security policies past max allowed

Alexander Turinske requested to merge 450752-prevent-enable-past-max into master

What does this MR do and why?

Prevent enabling security policies past max allowed

  • disable radio button if max number of security policy types are enabled
  • do not prevent users from disabling an enabled policy

Changelog: changed

EE: true

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Scenario Screenshot
Max not reached or policy already enabled policy_enabled
Max reached for scan execution policies scan_execution
Max reached for merge request policies merge_request
Max reached and trying to update enabled in yaml mode disabled the save button image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Upload a GitLab Ultimate license
  2. Navigate to a project/group => Secure => Policies => New policy
  3. Navigate to a type of policy => Create 5+ enabled policies and 1 policy not enabled of one type
  4. Navigate to the project/group => Secure => Policies => Select an enabled policy => Click Edit policy in the drawer
  5. Verify the policy can be disabled
  6. Verify the tooltip does not appear when hovering over the radio buttons
  7. Navigate to the project/group => Secure => Policies => Select a disabled policy => Click Edit policy in the drawer
  8. Verify the policy cannot be disabled
  9. Verify the tooltip appears when hovering over the radio buttons
  10. Navigate to yaml mode
  11. Update enabled to true
  12. Verify the save button is disabled
  13. Verify the tooltip appears when hovering over the save button

Related to #450752 (closed)

Edited by Alexander Turinske

Merge request reports