This hook is invoked from user_cancel() before a user account is canceled.
Depending on the account cancellation method, the module should either do
nothing, unpublish content, or anonymize content. See user_cancel_methods()
for the list of default account cancellation methods provided by User module.
Modules may add further methods via hook_user_cancel_methods_alter().

This hook is NOT invoked for the 'user_cancel_delete' account cancellation
method. To react on this method, implement hook_user_delete() instead.

Expensive operations should be added to the global account cancellation batch
by using batch_set().

Comments

If you don't want to apply the same account cancellation method to all roles, you can check them in hook_user_cancel. In my example, if a user is not an 'editor' (and hasn't created any content in my site), I prefer delete completely his account. I hope this can be helpful.