Netcentric / accesscontroltool

Rights and roles management for AEM made easy
Eclipse Public License 1.0
147 stars 92 forks source link

When using path restrictions, initial content is not created reliably #640

Closed ghenzler closed 1 year ago

ghenzler commented 1 year ago

The following config


- ace_config:

    - fragment-dam-content:

        - path: /content/dam/initial-content-test/L1/L2/L3/L4/L5
          initialContent: |
            <jcr:root jcr:primaryType="sling:OrderedFolder">
              <jcr:content
                       jcr:primaryType="nt:unstructured"
                       jcr:title="L5"/>
            </jcr:root>

        - path: /content/dam/initial-content-test/L1/L2/L3/L4
          initialContent: |
            <jcr:root jcr:primaryType="sling:OrderedFolder">
              <jcr:content
                       jcr:primaryType="nt:unstructured"
                       jcr:title="L4"/>
            </jcr:root>

        - path: /content/dam/initial-content-test/L1/L2/L3
          initialContent: |
            <jcr:root jcr:primaryType="sling:OrderedFolder">
              <jcr:content
                       jcr:primaryType="nt:unstructured"
                       jcr:title="L3"/>
            </jcr:root>

        - path: /content/dam/initial-content-test/L1/L2
          initialContent: |
            <jcr:root jcr:primaryType="sling:OrderedFolder">
              <jcr:content
                       jcr:primaryType="nt:unstructured"
                       jcr:title="L2"/>
            </jcr:root>

        - path: /content/dam/initial-content-test/L1
          initialContent: |
            <jcr:root jcr:primaryType="sling:OrderedFolder">
              <jcr:content
                       jcr:primaryType="nt:unstructured"
                       jcr:title="L1"/>
            </jcr:root>

        - path: /content/dam/initial-content-test
          initialContent: |
            <jcr:root jcr:primaryType="sling:OrderedFolder">
              <jcr:content
                       jcr:primaryType="nt:unstructured"
                       jcr:title="Initial Content Test"/>
            </jcr:root>

will cause missing paths (WARNING: There were 6 parent paths missing for creation of initial content (those paths were skipped, see verbose log for details)) when running the AC Tool at /system/console/actool with parameters Configuration Root Path /apps/initial-content-test and Base Path /content

It seems the path ordering is missing to ensure shorter path segments are created first when using the path restriction in UI via Base Path(s).