karlpauls commented on a change in pull request #52:
URL:
https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/52#discussion_r558314269
##########
File path:
src/main/java/org/apache/sling/feature/cpconverter/accesscontrol/DefaultAclManager.java
##########
@@ -150,6 +164,20 @@ public void addRepoinitExtension(@NotNull
List<VaultPackageAssembler> packageAss
}
}
+ private String calculateIntermediatePath(RepoPath intermediatePath) {
+ if (enforcePrincipalBased && supportedPrincipalBasedPath!= null &&
!intermediatePath.startsWith(supportedPrincipalBasedPath)) {
+ RepoPath parent = supportedPrincipalBasedPath.getParent();
+ if (parent.equals(intermediatePath)) {
+ return supportedPrincipalBasedPath.toString();
+ } else {
+ String relpath =
intermediatePath.toString().substring(parent.toString().length());
+ return supportedPrincipalBasedPath.toString() + relpath;
+ }
+ } else {
+ return intermediatePath.toString();
+ }
+ }
+
private boolean aclStartsWith(RepoPath path) {
Review comment:
Right, that is why the group does both:
if (aclStartsWith(group.getPath())) {
formatter.format("create group %s with path %s%n",
group.getId(), group.getIntermediatePath());
}
if (aclIsBelow(group.getPath())) {
throw new IllegalStateException("Detected policy on
subpath of group: " + group);
}
I think that is doing what you want - just in a roundabout way, no?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]