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:
<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"/>
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?
I don't believe it's possible, since ACL nodes are protected and only modified via the AccessControlManager implementation.