Add policy scope setting to existing policies
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
Scenario | Before | After |
---|---|---|
Group policy - both new and existing | No visual change | |
A new or existing policy on a project that is not being used as a SPP | no visual change | |
A new policy on a project that is being used as a SPP | No visual change | |
An existing policy on a project that is being used as a SPP | edit_policy_of_spp-_a |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Enable Feature Flags
echo "Feature.enable(:security_policies_policy_scope) && Feature.enable(:security_policies_policy_scope_project)" | gdk rails c
- Navigate to a group => Settings --> General --> Permissions and group features section
- Enable Security policy scope
- Navigate to Secure --> Policies --> Edit policy project --> Select a project in the group
- Navigate to the newly selected project --> Secure --> Policies --> New Policy --> Result or Execution policy
- Verify the policy scope section appears without the checkbox
- Save the policy
- Navigate back to the project in the group --> Secure --> Policies
- Select the policy you just created and click "Edit policy"
- Verify the policy scope section has the check box for the default policy scope
- Navigate to a project not being used as a SPP --> Secure --> Policies --> New Policy --> Result or Execution policy
- Verify there is only text
Related to #441520 (closed)
Edited by Alexander Turinske