Add policy scope on project level
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 |
|
SPP project with multiple linked projects |
|
SPP project with one linked project (wording is still in review) |
|
Regular project (wording is still in review) |
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 | |
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)
- Go to Settings -> General
- Toggle the Permissions and group features section
- Enable Security policy scope
- Go to Project
- Secure -> Policies -> New Policy -> result or execution policy
- Make sure you see UI for regular project under policy scope section (see in table)
- Go to any other group or project
- Secure -> Policies -> Edit policy project
- Link project from step 3 to at least two other items (groups or projects)
- Go back to project from step 3 and make sure you see UI
SPP project
with multiple linked projects (see in table) - Create policy for this project, then try to edit switch between rule mode yaml mode
- Unlink project from step 3 from projects groups that you have linked it too, leave only one dependency
- 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