11-16-2017 06:00 AM
Hi people :) I need to take the title of a document using java code even when the user doesn't have permission to see it.Can someone tell me if this is possible?
11-17-2017 08:19 AM
Use a privileged session:
DocumentRef ref = doc.getRef();
String title = CoreInstance.doPrivileged(doc.getCoreSession(),
(CoreSession privilegedSession) -> (String) privilegedSession.getDocument(ref).getPropertyValue("dc:title")
);
11-17-2017 11:21 AM
It's equivalent but UnrestrictedSessionRunner is more verbose.
11-17-2017 11:21 AM
Thank you Florent,but i found another way using UnrestrictedSessionRunner.I think this is better because i have to iterate through the parents of a document too.
Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.
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.