The user that delete an item should see the item in the trashcan
|Reported by:||Nicklas Nordborg||Owned by:||Nicklas Nordborg|
The current trashcan functionality can only display items that the currently logged in user is the owner of.
If a user that is not the owner delete an item it will not show up in that user's trashcan. This is a bit annoying in a large project where different items are owned by different users but once in a while an administrator need to clean up something. The administrator typically has DELETE permission but then has to ask other users (or use the impersonate functionality) to empty the trashcans.
A workaround is to enable the 'removed' option in the 'view/presets' list and use the trashcan icon for each item. This may be okay for a few items, but not when deleting lots of items at the same time.
It would be nice if the user that deleted an item actually could see that item in the own trashcan.
A possible solution to this issue is to replace the boolean
isRemoved property of items with a nullable integer
removedBy property. Null values are the same as 'not removed' and non-null values is the id of the user that removed the item. When listing items in the trashcan we could simply include items which has
owner=<id-of-current-user> OR removedBy=<id-of-current-user>.
For existing items with the removed flag set we simply set