moin icon indicating copy to clipboard operation
moin copied to clipboard

Unable to delete/destroy users

Open kwatsen opened this issue 6 years ago • 5 comments

Admin/Users/ (e.g., +admin/userbrowser) enables disabling users, but I created a bunch of test accounts that I'd like to get rid of (destroy).

FWIW, the ./m command line utility and friends also don't seem to support deleting users.

kwatsen avatar Aug 05 '19 16:08 kwatsen

the problem with nuking users is that the edit history (revision metadata) contains a reference to the user who created the revision. that reference would be invalid if you completely get rid of users, so moin does only offer to disable them, to keep that reference intact.

ThomasWaldmann avatar Aug 07 '19 15:08 ThomasWaldmann

Okay, I see what you mean, but then can the "disabled" users be dropped via maint-reduce-revisions?

kwatsen avatar Aug 07 '19 19:08 kwatsen

reduce-revisions is (as the name says) a means to reduce the amount of revisions of an item (keep latest revisions, drop all older revisions). it is not intended to kill the whole item by removing all revisions.

there could be a separate special admin command to drop disabled users, but we better first check what the consequences are for items referring to non-existing users.

ThomasWaldmann avatar Aug 08 '19 12:08 ThomasWaldmann

Perhaps it would be easier (and enough?) to delete users only if they own no revisions:

  • if the account has never created/modified a page, it can be deleted automatically
  • else, it will be deletable when reduce-revision will remove the last reference to the account.

There is a limit: if an account has modified a page which is never modified, there will no new revisions so the account will never be droppable.

sblondon avatar Jun 02 '20 11:06 sblondon

It is not just the current revision that links to an editor, but all revisions of an item. Deleting (destroying) last editor of an item causes a traceback when viewing the item. Deleting prior editor of an item causes traceback when viewing item's history.

To remove all traces of a rouge user:

  • create admin function to list all revisions modified by a user (there is +mychanges to show all revisions made by current logged in user, but no function to show changes made by some other user)
  • destroy all revisions modified by a user (functionality to destroy one revision at a time already exists on the UI subject to ACL rules))
  • create admin function to destroy a user after verifying there are no revisions made by target user

RogerHaase avatar Sep 12 '23 18:09 RogerHaase