Hi,
Unfortunately, the path is hard-coded. Here is a small example demonstrating this:
$ iput irodsctl /tempZone/project/foo
$ ils -l /tempZone/project/foo
rods 0 a5999d951044Resource 283 2021-09-08.12:55 & foo
$ irm /tempZone/project/foo
$ ils -lr /tempZone/trash
/tempZone/trash:
C- /tempZone/trash/home
/tempZone/trash/home:
C- /tempZone/trash/home/public
/tempZone/trash/home/public:
C- /tempZone/trash/home/rods
/tempZone/trash/home/rods:
C- /tempZone/trash/home/rods/project
/tempZone/trash/home/rods/project:
rods 0 a5999d951044Resource 283 2021-09-08.12:55 & foo
So, no matter where the data object originates, it will always end up moving from /zonename/path/to/object to /zonename/trash/home/object_owner_user/path/to/object.
I don't know what your existing rule looks like, but I would suggest using a dynamic policy enforcement point for the endpoint used by irm, which would be pep_api_data_obj_unlink_*. The most straightforward approach, I think, would be to implement pep_api_data_obj_unlink_post to
msiDataObjRename the data object in the trash (logical path should be available from
the REI) to the desired path.
You could also try a similar but reverse approach with
pep_api_data_obj_unlink_pre, although this seems... less safe/straightforward:
1. Define acTrashPolicy to call msiNoTrashCan so that things do not move to the trash.
2. In
pep_api_data_obj_unlink_pre, msiDataObjCopy the object to the desired path (/zonename/trash/work/...).
3. Allow the unlink operation to proceed as normal.
In this way, the original data object will be unlinked and the new data object will be in the "custom" trash can.
I have not tried either of these, but I see no reason they wouldn't work. Let us know if you have questions!