Skip to content

Add policy scope on project level

Artur Fedorov requested to merge 432513-policies-existing-policy-scope into master

What does this MR do and why?

This MR request adds policy scope section on project level.

Previously it was available only on Group level

Here is how expected UI should look like:

Policy type in policy editor UI
Group/subgroups Screenshot 2024-02-15 at 16.56.58.png
SPP project with multiple linked projects Screenshot 2024-02-15 at 16.56.58.png
SPP project with one linked project (wording is still in review) Screenshot 2024-02-02 at 23.35.49.png
Regular project (wording is still in review) Screenshot 2024-02-02 at 23.35.49.png

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.

Description UI
SPP project with single and multiple linked project/group loom video
Regular project with no linked dependecies regular project.png
Group level (unchanged) Loom video

How to set up and validate locally

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

Enable Feature Flag

Feature.enable(:security_policies_policy_scope)
Feature.enable(:security_policies_policy_scope_project)
  1. Go to Settings -> General
  2. Toggle the Permissions and group features section
  3. Enable Security policy scope
  4. Go to Project
  5. Secure -> Policies -> New Policy -> result or execution policy
  6. Make sure you see UI for regular project under policy scope section (see in table)
  7. Go to any other group or project
  8. Secure -> Policies -> Edit policy project
  9. Link project from step 3 to at least two other items (groups or projects)
  10. Go back to project from step 3 and make sure you see UI SPP project with multiple linked projects (see in table)
  11. Create policy for this project, then try to edit switch between rule mode yaml mode
  12. Unlink project from step 3 from projects groups that you have linked it too, leave only one dependency
  13. Go back to project, make sure you see UI SPP project with one linked project (see in table)

Related to #432513 (closed)

Edited by Artur Fedorov

Merge request reports