Tree entry = principalRoot.addChild(name);
entry.setProperty(JCR_PRIMARYTYPE, NT_REP_PERMISSIONS);
entry.setProperty(REP_ACCESS_CONTROLLED_PATH, path);
entry.setProperty(REP_IS_ALLOW, isAllow);
entry.setProperty(REP_INDEX, index);
entry.setProperty(pb.asPropertyState(REP_PRIVILEGE_BITS));
for (Restriction restriction : restrictions) {
entry.setProperty(restriction.getProperty());
}
root.commit();
}