Do not override first init system roles in DEV mode.
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 3 Feb 2020 08:21:43 +0000 (09:21 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 3 Feb 2020 08:21:43 +0000 (09:21 +0100)
org.argeo.cms/src/org/argeo/cms/internal/kernel/InitUtils.java

index ef6a267c6e85150c1e566905412ec8066436537d..ebb2ef8f7f3934f8652bde4ee3ac9d938d7dd534 100644 (file)
@@ -162,8 +162,9 @@ class InitUtils {
                                try {
                                        FileUtils.copyInputStreamToFile(InitUtils.class.getResourceAsStream(demoBaseDn + ".ldif"),
                                                        businessRolesFile);
-                                       FileUtils.copyInputStreamToFile(
-                                                       InitUtils.class.getResourceAsStream("example-ou=roles,ou=node.ldif"), systemRolesFile);
+                                       if (!systemRolesFile.exists())
+                                               FileUtils.copyInputStreamToFile(
+                                                               InitUtils.class.getResourceAsStream("example-ou=roles,ou=node.ldif"), systemRolesFile);
                                } catch (IOException e) {
                                        throw new CmsException("Cannot copy demo resources", e);
                                }