SLING-8544 - [cp2fm] service users need to be created with intermediate
path
use the absolute path to create service user
diff --git a/src/main/java/org/apache/sling/feature/cpconverter/acl/DefaultAclManager.java b/src/main/java/org/apache/sling/feature/cpconverter/acl/DefaultAclManager.java
index 11c8c4c..c6a8819 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/acl/DefaultAclManager.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/acl/DefaultAclManager.java
@@ -110,7 +110,7 @@
// make sure all users are created first
- formatter.format("create service user %s with path %s%n", systemUser.getId(), systemUser.getPath().getFileName());
+ formatter.format("create service user %s with path /home/users/system/%s%n", systemUser.getId(), systemUser.getPath().getFileName());
// create then the paths
diff --git a/src/test/java/org/apache/sling/feature/cpconverter/acl/AclManagerTest.java b/src/test/java/org/apache/sling/feature/cpconverter/acl/AclManagerTest.java
index 2fc239b..8dc0a08 100644
--- a/src/test/java/org/apache/sling/feature/cpconverter/acl/AclManagerTest.java
+++ b/src/test/java/org/apache/sling/feature/cpconverter/acl/AclManagerTest.java
@@ -73,7 +73,7 @@
assertNotNull(repoinitExtension);
// acs-commons-on-deploy-scripts-service will be missed
- String expected = "create service user acs-commons-package-replication-status-event-service with path public\n" +
+ String expected = "create service user acs-commons-package-replication-status-event-service with path /home/users/system/public\n" +
"create path (sling:Folder) /asd\n" +
"create path (sling:Folder) /asd/public\n" +
"set ACL for acs-commons-package-replication-status-event-service\n" +
diff --git a/src/test/java/org/apache/sling/feature/cpconverter/handlers/RepPolicyEntryHandlerTest.java b/src/test/java/org/apache/sling/feature/cpconverter/handlers/RepPolicyEntryHandlerTest.java
index a94cf52..a8eea3f 100644
--- a/src/test/java/org/apache/sling/feature/cpconverter/handlers/RepPolicyEntryHandlerTest.java
+++ b/src/test/java/org/apache/sling/feature/cpconverter/handlers/RepPolicyEntryHandlerTest.java
@@ -87,29 +87,29 @@
assertNotNull(repoinitExtension);
assertEquals(ExtensionType.TEXT, repoinitExtension.getType());
- String expected = "create service user acs-commons-ensure-oak-index-service with path public\n" +
+ String expected = "create service user acs-commons-ensure-oak-index-service with path /home/users/system/public\n" +
"create path (sling:Folder) /asd\n" +
"create path (sling:Folder) /asd/public\n" +
"set ACL for acs-commons-ensure-oak-index-service\n" +
"allow jcr:read,rep:write,rep:indexDefinitionManagement on /asd/public restriction(rep:glob,*/oak:index/*)\n" +
"end\n" +
- "create service user acs-commons-dispatcher-flush-service with path public\n" +
+ "create service user acs-commons-dispatcher-flush-service with path /home/users/system/public\n" +
"set ACL for acs-commons-dispatcher-flush-service\n" +
"allow jcr:read,crx:replicate,jcr:removeNode on /asd/public\n" +
"end\n" +
- "create service user acs-commons-package-replication-status-event-service with path public\n" +
+ "create service user acs-commons-package-replication-status-event-service with path /home/users/system/public\n" +
"set ACL for acs-commons-package-replication-status-event-service\n" +
"allow jcr:read,rep:write,jcr:readAccessControl,jcr:modifyAccessControl on /asd/public\n" +
"end\n" +
- "create service user acs-commons-ensure-service-user-service with path public\n" +
+ "create service user acs-commons-ensure-service-user-service with path /home/users/system/public\n" +
"set ACL for acs-commons-ensure-service-user-service\n" +
"allow jcr:read,rep:write,jcr:readAccessControl,jcr:modifyAccessControl on /asd/public\n" +
"end\n" +
- "create service user acs-commons-automatic-package-replicator-service with path public\n" +
+ "create service user acs-commons-automatic-package-replicator-service with path /home/users/system/public\n" +
"set ACL for acs-commons-automatic-package-replicator-service\n" +
"allow jcr:read on /asd/public\n" +
"end\n" +
- "create service user acs-commons-on-deploy-scripts-service with path public\n" +
+ "create service user acs-commons-on-deploy-scripts-service with path /home/users/system/public\n" +
"set ACL for acs-commons-on-deploy-scripts-service\n" +
"allow jcr:read on /asd/public\n" +
"end\n";
@@ -126,21 +126,21 @@
assertNotNull(repoinitExtension);
assertEquals(ExtensionType.TEXT, repoinitExtension.getType());
- String expected = "create service user acs-commons-package-replication-status-event-service with path public\n" +
+ String expected = "create service user acs-commons-package-replication-status-event-service with path /home/users/system/public\n" +
"create path (sling:Folder) /asd\n" +
"create path (sling:Folder) /asd/public\n" +
"set ACL for acs-commons-package-replication-status-event-service\n" +
"allow jcr:read,rep:write,jcr:readAccessControl,jcr:modifyAccessControl on /asd/public\n" +
"end\n" +
- "create service user acs-commons-ensure-service-user-service with path public\n" +
+ "create service user acs-commons-ensure-service-user-service with path /home/users/system/public\n" +
"set ACL for acs-commons-ensure-service-user-service\n" +
"allow jcr:read,rep:write,jcr:readAccessControl,jcr:modifyAccessControl on /asd/public\n" +
"end\n" +
- "create service user acs-commons-automatic-package-replicator-service with path public\n" +
+ "create service user acs-commons-automatic-package-replicator-service with path /home/users/system/public\n" +
"set ACL for acs-commons-automatic-package-replicator-service\n" +
"allow jcr:read on /asd/public\n" +
"end\n" +
- "create service user acs-commons-on-deploy-scripts-service with path public\n" +
+ "create service user acs-commons-on-deploy-scripts-service with path /home/users/system/public\n" +
"set ACL for acs-commons-on-deploy-scripts-service\n" +
"allow jcr:read on /asd/public\n" +
"end\n";
diff --git a/src/test/java/org/apache/sling/feature/cpconverter/handlers/SystemUsersEntryHandlerTest.java b/src/test/java/org/apache/sling/feature/cpconverter/handlers/SystemUsersEntryHandlerTest.java
index a4f133a..c43d3a5 100644
--- a/src/test/java/org/apache/sling/feature/cpconverter/handlers/SystemUsersEntryHandlerTest.java
+++ b/src/test/java/org/apache/sling/feature/cpconverter/handlers/SystemUsersEntryHandlerTest.java
@@ -76,7 +76,7 @@
assertEquals(ExtensionType.TEXT, repoinitExtension.getType());
assertTrue(repoinitExtension.isRequired());
- String expected = "create service user asd-share-commons-asd-index-definition-reader-service with path asd-index-definition-reader\n";
+ String expected = "create service user asd-share-commons-asd-index-definition-reader-service with path /home/users/system/asd-index-definition-reader\n";
String actual = repoinitExtension.getText();
assertEquals(expected, actual);
}