in src/main/java/org/apache/sling/feature/cpconverter/accesscontrol/DefaultAclManager.java [322:345]
private void addStatements(@NotNull SystemUser systemUser,
@NotNull List<AccessControlEntry> authorizations,
@NotNull Formatter formatter) {
Map<AccessControlEntry, String> resourceEntries = new LinkedHashMap<>();
Map<AccessControlEntry, String> principalEntries = new LinkedHashMap<>();
authorizations.forEach(entry -> {
String path = getRepoInitPath(entry.getRepositoryPath(), systemUser);
if (entry.isPrincipalBased() || enforcePrincipalBased(systemUser)) {
principalEntries.put(entry, path);
} else {
resourceEntries.put(entry, path);
}
});
if (!principalEntries.isEmpty()) {
SetAclPrincipalBased operation = new SetAclPrincipalBased(Collections.singletonList(systemUser.getId()), asAcLines(principalEntries));
formatter.format("%s", operation.asRepoInitString());
}
if (!resourceEntries.isEmpty()) {
SetAclPrincipals operation = new SetAclPrincipals(Collections.singletonList(systemUser.getId()), asAcLines(resourceEntries));
formatter.format("%s", operation.asRepoInitString());
}
}