feat: delete groups for user while deleting user (#3525)

This commit is contained in:
DacongDA 2025-01-23 09:46:33 +08:00 committed by GitHub
parent 06986fbd41
commit 9701818a6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -965,6 +965,14 @@ func DeleteUser(user *User) (bool, error) {
return false, err
}
ok, err := userEnforcer.DeleteGroupsForUser(user.GetId())
if err != nil {
return false, err
}
if !ok {
return false, nil
}
organization, err := GetOrganizationByUser(user)
if err != nil {
return false, err