Skip to content

Add policy scope setting to existing policies

Alexander Turinske requested to merge 441520-add-policy-scope-for-projects into master

What does this MR do and why?

Add policy scope setting to existing policies

  • add checkbox for existing project policies only
  • allow for the "policy_scope" setting to be removed
  • update tests

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.

NOTE: the default policy scope has been updated so these are all a little out-of-date

image

Scenario Before After
Group policy - both new and existing group_scope_-_a No visual change
A new or existing policy on a project that is not being used as a SPP image no visual change
A new policy on a project that is being used as a SPP image No visual change
An existing policy on a project that is being used as a SPP image edit_policy_of_spp-_a

How to set up and validate locally

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

  1. Enable Feature Flags
echo "Feature.enable(:security_policies_policy_scope) && Feature.enable(:security_policies_policy_scope_project)" | gdk rails c
  1. Navigate to a group => Settings --> General --> Permissions and group features section
  2. Enable Security policy scope
  3. Navigate to Secure --> Policies --> Edit policy project --> Select a project in the group
  4. Navigate to the newly selected project --> Secure --> Policies --> New Policy --> Result or Execution policy
  5. Verify the policy scope section appears without the checkbox
  6. Save the policy
  7. Navigate back to the project in the group --> Secure --> Policies
  8. Select the policy you just created and click "Edit policy"
  9. Verify the policy scope section has the check box for the default policy scope
  10. Navigate to a project not being used as a SPP --> Secure --> Policies --> New Policy --> Result or Execution policy
  11. Verify there is only text

Related to #441520 (closed)

Edited by Alexander Turinske

Merge request reports