[
https://issues.apache.org/jira/browse/OAK-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14591665#comment-14591665
]
Robert Munteanu commented on OAK-2747:
--------------------------------------
It seems that the Oak implementation of the {{LockManager}} prevents a checkout
operation is the Node is locked. The Jackrabbit implementation allows a
checkout if the node is not locked or if the user is the lock owner ( that is
true for all operations as far as I can tell, not only for versioning related
ones ).
My suggested approach would be:
* expose the logic for for {{canUnlock}} from Oak's {{LockManagerImpl}}, either
as a util class or as as Oak-internal interface
* make use of that logic in {{VersionManagerImpl.checkNotLocked}}
{code:java|title=LockManagerImpl.java}
if (sessionContext.getSessionScopedLocks().contains(path)
|| sessionContext.getOpenScopedLocks().contains(path)) {
return true;
} else if (sessionContext.getAttributes().get(RELAXED_LOCKING)
== TRUE) {
String user =
sessionContext.getSessionDelegate().getAuthInfo().getUserID();
return node.isLockOwner(user) || isAdmin(sessionContext,
user);
} else {
return false;
}
{code}
> Admin cannot create versions on a locked page by itself
> -------------------------------------------------------
>
> Key: OAK-2747
> URL: https://issues.apache.org/jira/browse/OAK-2747
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: core, jcr
> Affects Versions: 1.2.1
> Reporter: Marius Petria
> Fix For: 1.4
>
>
> Admin cannot create versions even if it is the lockowner.
> This is a test to go in VersionManagementTest that shows the issue.
> The general questions are:
> - should de lockowner be able to create versions?
> - should admin be able to create versions even if it is not the lockowner?
> {code}
> @Test
> public void testCheckInCheckoutLocked() throws Exception {
> Node n = createVersionableNode(superuser.getNode(path));
> n.addMixin(mixLockable);
> superuser.save();
> n = superuser.getNode(n.getPath());
> n.lock(true, false);
> testSession.save();
> n = superuser.getNode(n.getPath());
> n.checkin();
> n.checkout();
> }
> {code}
> fails with
> {noformat}
> javax.jcr.lock.LockException: Node at /testroot/node1/node1 is locked
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)