1 Reply Latest reply on Dec 1, 2014 1:00 PM by rhauch

    How to specify ACLs in Initial Content (ModeShape 4.0.0)

    jkraushaar

      Hi there,

       

      we are using ModeShape 4.0.0 and like to create some initial content when a workspace / repository is created. We also use ACLs to authorize users on nodes. Our initial content file looks like this:

       

      <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0">

         <folder jcr:name="main" jcr:description="The root folder" jcr:mixinTypes="mix:title,mode:accessControllable" jcr:primaryType="nt:folder">

            <acl jcr:name="mode:acl" jcr:primaryType="mode:Acl">

               <admin jcr:name="admin" jcr:primaryType="mode:Permission" privileges="jcr:all"/>

            </acl>

         </folder>

      </jcr:root>

       

      When the repository starts, following exception is thrown:

       

      javax.jcr.nodetype.ConstraintViolationException: Unable to add child 'mode:acl' with primary type 'mode:Acl' to parent at /main with primary type 'nt:folder' and mixins mode:accessControllable,mix:title} in workspace 'default' of repository 'repo' because:

      - parent's child definition is protected: mode:accessControllable/mode:acl (required primary types = [mode:Acl])

      - child's primary type 'mode:Acl' does not satisfy parent's child definition: nt:folder/* (required primary types = [nt:hierarchyNode])

       

      Is it possible to specify ACLs in initial content? And if yes, how?

       

      Regards

      Jochen