How to disable document's link generated by Nuxeo after document gets trashed?

I have uploaded a document in Nuxeo and got a link. I can download my document accessing that link. Now, I trashed my document and got “isTrashed”: true as well but still I can download my document using the link which is generated by Nuxeo. Is there any way by which I can restrict access to that URL after a document is trashed?

0 votes

1 answers




Settting a document to trash only update the ecm:isTrashed propertty value but doesn't have an impact on the URL. This allows you to easily untrash a documentt (and consequenttly, not ot regenerate an URL). For this use case, it probably needs to implement a custom secutiry policy ( ).

With something like this in your checkPermission method:

Boolean isTrashed = Optional.ofNullable((Boolean) doc.getValue("ecm:isTrashed"))
            if (isTrashed) {
                return Access.DENY;
         else {
         return Access.UNKNOWN
1 votes

Hi. I think you wanted to put "isConfidential" in the "if" condition; or to call the Boolean "isTrashed"! Regards.

Indeed! Updated