Unable to edit or add new policies after project deletion
**Summary**: Policies cannot be edited or added once the security policy project is deleted. Steps to reproduce the issue: 1. Create a group and a project 2. Add new policy: I have tested with the merge request approval policy 3. Add a MR to confirm that the policy is working and that the approval is needed 4. As a group owner go to the Security project policy settings and delete the project 5. A message will be returned that the project is read only 6. While trying to edit or add new policy the following message is returned: You are not allowed to push into this branch 7. ![Screenshot_2024-08-09_at_16.17.55](/uploads/1ebbf05792f9ae9bc8a6d98b65aa05e7/Screenshot_2024-08-09_at_16.17.55.png) 8. Policies are still in place once the project was removed ![Screenshot_2024-08-09_at_16.48.05](/uploads/c52e1597866abd77103e9278038b00cd/Screenshot_2024-08-09_at_16.48.05.png) Why this might be a bug: - It could lock a group in the case of misconfigured policies and deletion of the policies project. ## Proposal > prevent from deleting the project when it is linked as SPP to other groups/projects -\> we could list projects/groups and ask user to unlink them first before proceeding with deletion
epic