06-19-2020 03:33 AM
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?
06-20-2020 03:23 PM
Hello,
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 (https://doc.nuxeo.com/nxdoc/security-policy-service/
).
With something like this in your checkPermission
method:
Boolean isTrashed = Optional.ofNullable((Boolean) doc.getValue("ecm:isTrashed"))
.orElse(Boolean.FALSE);
if (isTrashed) {
return Access.DENY;
}
else {
return Access.UNKNOWN
}
06-21-2020 04:55 AM
Hi. I think you wanted to put "isConfidential" in the "if" condition; or to call the Boolean "isTrashed"! Regards.
06-21-2020 12:02 PM
Indeed! Updated
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.