Fórum

User Deletion

thumbnail
Brett Lewinski, modificado 7 Anos atrás.

User Deletion

Junior Member Postagens: 54 Data de Entrada: 04/05/11 Postagens Recentes
Greeting -

Just curious what happens to user data if the user who is the owner of the data is deleted (not deactivated) from the portal? Is the data removed with the user? If not whom is assigned ownership of the data? I haven't been able to find it documented anywhere.

Your help is greatly appreciated!

Thanks
Brett
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: User Deletion

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Liferay does not use enforced foreign keys. The original user id will stick with the record, you'll just end up with errors in the logs about missing users and such.

I typically recommend not deleting user accounts as it loses your logical key reference data. It's fine to leave the users as disabled, they won't be able to log in, and your ownership details will still be valid.
thumbnail
Brett Lewinski, modificado 7 Anos atrás.

RE: User Deletion

Junior Member Postagens: 54 Data de Entrada: 04/05/11 Postagens Recentes
David

Thanks, unfortunately we need to completely remove users who's accounts are no longer valid. It would be nice if Liferay handled the errors more graciously rather than gunking up the logs emoticon

Thanks for the help it is much appreciated.

Brett
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: User Deletion

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
You could build out a model listener for user and, onBeforeRemove(), walk the system changing ownership for files/folders/posts/etc. that you want to have updated, but it's a manual process. Once you start building it out, you'll realize why LR i) doesn't do that themselves because of the complexity and the decision about who should own (as owner affects permissioning) and ii) it takes some time to complete, especially if you're getting rid of a prolific contributor.