PropertyState mixins = tree.getProperty(JcrConstants.JCR_MIXINTYPES);
String mixinName = AccessControlUtils.getMixinName(oakPath);
if (mixins == null) {
tree.setProperty(JcrConstants.JCR_MIXINTYPES, Collections.singleton(mixinName), Type.NAMES);
} else {
PropertyBuilder pb = PropertyUtil.getPropertyBuilder(Type.NAME, mixins);
pb.addValue(mixinName);
tree.setProperty(pb.getPropertyState());
}
}
String aclName = AccessControlUtils.getAclName(oakPath);
return new NodeUtil(tree).addChild(aclName, NT_REP_ACL).getTree();
}