Problem/Motivation
When cancelling an account, the only option to reassign content is to the anonymous account.
Proposed resolution
Add the ability to specify a user content will be reassigned.
User interface changes
tbd
Data model changes
tbd
Original report by hctom
Hi @all,
I'm not sure, if I'm too late for the API changes feature request, but I think it would be quite useful to tweak the "Delete the account and make all content belong to the Anonymous user." method for cancelled accounts.
It would be great to have an autocomplete field, too choose the user the content is reassigned to instead of always using the anonymous user. If the field is left empty, a default value should be used. This may either be the anonymous or a configurable setting value should be available for this.
Of course, this tweak for method may only be available to privileged users (e.g. with "Administer users" permission or even an own permission for this selection), so non-admin users with the "Select method for cancelling own account" may not reassign contents to other users by default (as this may be abused).
With this tweak site administrators may be able to set up a special account like "Deleted person" to reassign the content to. The may also reassign contents to the correct user, when two accounts need to be merged by cancelling one of them.
The corresponding uid may be transferred to hook_user_cancel() via the $edit parameter, so there is no need to change the hook's function signature. Only the performed queries need to be altered slightly to use the passed uid instead of 0.
So... what do you think about this proposal?
I'd appreciate, getting feedback for this.
Thanx in advance & cheers
hctom
Comments
Comment #1
mrfelton CreditAttribution: mrfelton commentedsubs.
Comment #2
ilo CreditAttribution: ilo commentedJust to mention that with current user cancel API it can be done in a contrib module..
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedDrupal 7 has long been featured frozen.
Comment #4
jhedstromComment #7
dpiComment #9
Jieyyal CreditAttribution: Jieyyal commentedHi @hctom
There is already a contrib module available for D7.
https://www.drupal.org/project/move_user
Port to Drupal 8 is almost done.
https://www.drupal.org/node/2693353
Check more detail on github.
https://github.com/ciandt-china-dev/hackathon-drupal8-move_user
Thanks
Comment #14
dpiComment #15
dpiComment #16
dpiI think this issue would also solve the feature request to merge users. Per #2040139: Allow users to be merged
Comment #22
AnybodyI really really don't like Wordpress, but they have this option! And it's VERY handy if for example an employee leaves the company and another one takes his position, which isn't that untypical...
So +1 for an option to allow selecting a user to reassign contents when deleting an account instead of removing the user (assign to Guest). Overdue since Drupal 6, I guess? ;) (no offense, I didn't implement it either ;))
Also agree with #16, at least for all affected contents!
As VBO for example already has options to batch (re)assign entities ownership, it might make sense to generalize these functionalities into 10.x core?
I know this by far isn't as simple as it sounds, but I guess it's kind of base functionality for a mature CMS?
Comment #23
AnybodyRemoving Drupal 7 tag. @dpi should we perhaps change the Core version to 10.x? Would it make sense to discuss this in core team then?