When a document is deleted, there is no way to recover it. A document can be deleted by mistake, or by an intruder.
How should the recycle bin work:
- When a document is deleted, it is fully exported as XML and stored in a table
- A timestamp is also added to the recycled item
- A parameter in xwiki.cfg tells the minimum time a document must remain in the recycle before it can be completely removed
- A user with the "undelete" right can restore a document from the recycle bin
- A user with the "delete" right can permanently remove items from the recycle bin, only after the minimum waiting time has passed
- What if the page was created again?
- Restoring a trashed document should not replace the new one
- Deleting the new document should not replace the trashed one
- Possibility: while the document is still in the trash, display a notice: "This document was deleted"; users should have the possibility to request a restoration. This prevents a new document to be created while an older version is still in the recycle bin.
- Should the document still be accessible from the trash?
- If it's not too difficult
- How about a specific version?
- Should we allow restoring from a particular version, or restore only the final version?
- No, since this way an attacker can delete a page and restore only an empty version, making all other versions inaccessible.
- Should the trash be searchable?
- Not using the default search, since the recycle bin does not use the same tables as the default content