fix(user): revoke tunnel access when disabling users (#568)

Revoke tunnel grants and pause each forwarding entry without self-healing missing services. Continue healthy nodes and other forwards after failures, aggregate pending nodes for retry, and show persistent partial-disable feedback.

Related: #562
This commit is contained in:
sagit
2026-11-01 18:03:07 +08:00
committed by GitHub
parent 3549fe5ad8
commit 46bfb86c1b
8 changed files with 775 additions and 32 deletions
@@ -151,6 +151,13 @@ func (r *Repository) PropagateUserFlowToTunnels(userID int64, flow int64, num in
}).Error
}
func (r *Repository) DisableUserTunnels(userID int64) error {
if r == nil || r.db == nil {
return errors.New("repository not initialized")
}
return r.db.Model(&model.UserTunnel{}).Where("user_id = ?", userID).Update("status", 0).Error
}
func (r *Repository) DeleteUserCascade(userID int64) error {
if r == nil || r.db == nil {
return errors.New("repository not initialized")