Prevent custom role from being deleted if it is used in security policies
Why are we doing this work
- a custom role can be modified or deleted and a security policy could be affected by that
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
-
frontend / backend disable the Delete rolebutton if they are used in a policy -
frontend / backend show a tooltip with the existing policies and links to them
Similar to the override policy warning icon recently created
Verification steps
- Upload a GitLab Ultimate license
- Enable the feature
security_policy_custom_rolesfeature flag - Navigate to the admin level or top-level group => Settings => Roles and permissions
- Create a custom role
- Navigate to a group/project under that => Secure => Policies => New project => Merge request approval policy => Create a policy with the custom role as an approver
- Add a member as having that role
- Create a merge request and verify the approver appears
Edited by Alexander Turinske