Setting AccessControlEntry on a versioned Node throws exception
---------------------------------------------------------------
Key: JCR-1639
URL: https://issues.apache.org/jira/browse/JCR-1639
Project: Jackrabbit
Issue Type: Bug
Affects Versions: 1.5
Environment: windows vista jdk1.5.0_11
Reporter: Micah Whitacre
I realized the code is in flux and not released but I figured I'd log a bug
anyway to track the issue:
I have a repository where every node has the mixin type of "mix:versionable".
My repository.xml is setup to use the DefaultAccessManager and when I try to
make the following call:
AccessControlManager manager = sessionImpl.getAccessControlManager();
Privilege[] privs = new Privilege[] { PrivilegeRegistry.WRITE_PRIVILEGE
};
AccessControlEntry entry =
manager.addAccessControlEntry(fooNode.getPath(), principal,
privs);
sessionImpl.save();
on that node it throws the following exception:
Caused by: javax.jcr.version.VersionException: /cerner/foo: cannot add a mixin
node type to a checked-in node
at org.apache.jackrabbit.core.NodeImpl.addMixin(NodeImpl.java:1024)
at
org.apache.jackrabbit.core.security.authorization.acl.ACLEditor.createAclNode(ACLEditor.java:299)
at
org.apache.jackrabbit.core.security.authorization.acl.ACLEditor.setPolicyTemplate(ACLEditor.java:131)
at
org.apache.jackrabbit.core.security.authorization.acl.ACLEditor.addAccessControlEntry(ACLEditor.java:214)
at
org.apache.jackrabbit.core.security.DefaultAccessManager.addAccessControlEntry(DefaultAccessManager.java:389)
It has to do with the fact inside ACLEditor.createACLNode(...) it doesn't
checkout the node before trying to add the new mixin type of
NT_REP_ACCESS_CONTROLLABLE.
I'll work on craating a test case that will generate the stack trace.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.