use of javax.jcr.retention.RetentionManager in project jackrabbit by apache.
the class HoldTest method testReadOnlySession.
public void testReadOnlySession() throws NotExecutableException, RepositoryException {
javax.jcr.Session s = getHelper().getReadOnlySession();
try {
RetentionManager rmgr = getRetentionManager(s);
try {
rmgr.getHolds(testNodePath);
fail("Read-only session doesn't have sufficient privileges to retrieve holds.");
} catch (AccessDeniedException e) {
// success
}
try {
rmgr.addHold(testNodePath, getHoldName(), false);
fail("Read-only session doesn't have sufficient privileges to retrieve holds.");
} catch (AccessDeniedException e) {
// success
}
} finally {
s.logout();
}
}
Aggregations