You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2018/11/02 16:41:00 UTC
[jira] [Resolved] (OAK-7879) ACL can be modified on versioned node
without having to check-out the node first
[ https://issues.apache.org/jira/browse/OAK-7879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela resolved OAK-7879.
-------------------------
Resolution: Duplicate
Hi [~iosonomarco], as I wrote on the mailing list in a follow up comment, I found OAK-6015 this morning and I think it is a duplicate of this one. There in Marcel pointed to the part of the spec that explains the behaviour that I felt was a bug at a first glance (but apparently was mistaken).
> ACL can be modified on versioned node without having to check-out the node first
> --------------------------------------------------------------------------------
>
> Key: OAK-7879
> URL: https://issues.apache.org/jira/browse/OAK-7879
> Project: Jackrabbit Oak
> Issue Type: Bug
> Affects Versions: 1.8.8
> Reporter: Marco Piovesana
> Priority: Minor
>
> If I create the first version of a node *after* adding an ACE to it, then I can add or remove other ACE without having to checkout the node.
>
> If I create the first version of the node *before* adding the first ACE, then I get the error (_OakVersion0001: Cannot change property jcr:mixinTypes on checked in node_) whenever i try to modify the node permissions without checking it out first.
>
> Following a code snippet showing the first case:
>
> {code:java}
> Session adminSession = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
> UserManager userManager = ((JackrabbitSession) adminSession).getUserManager();
> User firstUser = userManager.createUser("firstUser", "firstUser", new PrincipalImpl("firstUser"), null);
> Principal firstUserPrincipal = firstUser.getPrincipal();
> adminSession.save();
> Node myFolder = JcrUtils.getOrAddNode(adminSession.getRootNode(), "my folder", "nt:folder");
> myFolder.addMixin(JcrConstants.MIX_VERSIONABLE);
> AccessControlUtils.addAccessControlEntry(adminSession, myFolder.getPath(), firstUserPrincipal, new String[]{Privilege.JCR_ALL}, true);
> adminSession.save();
> VersionManager versionManager = adminSession.getWorkspace().getVersionManager();
> versionManager.checkout(myFolder.getPath());
> versionManager.checkin(myFolder.getPath());
> AccessControlUtils.clear(myFolder, firstUserPrincipal.getName());
> AccessControlUtils.addAccessControlEntry(adminSession, myFolder.getPath(), firstUserPrincipal, new String[]{Privilege.JCR_READ}, true);
> adminSession.save();
> adminSession.logout();
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)