You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/06/15 18:33:00 UTC

[jira] [Updated] (JCRVLT-527) NodeTypeValidator: child node validation performed too early for folders

     [ https://issues.apache.org/jira/browse/JCRVLT-527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konrad Windszus updated JCRVLT-527:
-----------------------------------
    Description: 
The child node is immediately validated against the parent node definition in https://github.com/apache/jackrabbit-filevault/blob/14615ce5647252005f2271b5f5f0351eb91aa78e/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/JcrNodeTypeMetaDataImpl.java#L249. This is too early in case the child node is a folder, as the actual primary type (different from nt:folder) might be set with its file {{.content.xml}} only afterwards.

The problematic structure looks like this
{code}
+ parent
   - .content.xml (defining parent's primary type to e.g. rep:AuthorizableFolder)
   + child
      - .content.xml (defining child's primary type to e.g. rep:SystemUser)
{code}

This leads to errors like 
{code}
[ERROR] ValidationViolation: "jackrabbit-nodetypes: Node 'child [nt:folder]' is not allowed as child of node with types [rep:AuthorizableFolder]: Node type does not allow arbitrary child nodes and does not allow this specific name and node type either!", filePath=jcr_root/.../parent/child, nodePath=.../parent/child, line=7, column=6
{code}
when validating the child folder.

Concrete use case https://github.com/Netcentric/accesscontroltool/tree/develop/accesscontroltool-content-package/src/main/jcr_root/home/users/system/actool/actool-service

  was:
The child node is immediately validated against the parent node definition in https://github.com/apache/jackrabbit-filevault/blob/14615ce5647252005f2271b5f5f0351eb91aa78e/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/JcrNodeTypeMetaDataImpl.java#L249. This is too early in case this is a folder, as the actual primary type (different from nt:folder) might be set with its file {{.content.xml}} only afterwards.

This leads to errors like 
{code}
[ERROR] ValidationViolation: "jackrabbit-nodetypes: Node 'actool-service [nt:folder]' is not allowed as child of node with types [rep:AuthorizableFolder]: Node type does not allow arbitrary child nodes and does not allow this specific name and node type either!", filePath=jcr_root/home/users/system/actool/actool-service, nodePath=/home/users/system/actool/actool-service, line=7, column=6
{code}
when validating this folder: https://github.com/Netcentric/accesscontroltool/tree/develop/accesscontroltool-content-package/src/main/jcr_root/home/users/system/actool/actool-service


> NodeTypeValidator: child node validation performed too early for folders
> ------------------------------------------------------------------------
>
>                 Key: JCRVLT-527
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-527
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>            Priority: Major
>             Fix For: 3.5.2
>
>
> The child node is immediately validated against the parent node definition in https://github.com/apache/jackrabbit-filevault/blob/14615ce5647252005f2271b5f5f0351eb91aa78e/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/JcrNodeTypeMetaDataImpl.java#L249. This is too early in case the child node is a folder, as the actual primary type (different from nt:folder) might be set with its file {{.content.xml}} only afterwards.
> The problematic structure looks like this
> {code}
> + parent
>    - .content.xml (defining parent's primary type to e.g. rep:AuthorizableFolder)
>    + child
>       - .content.xml (defining child's primary type to e.g. rep:SystemUser)
> {code}
> This leads to errors like 
> {code}
> [ERROR] ValidationViolation: "jackrabbit-nodetypes: Node 'child [nt:folder]' is not allowed as child of node with types [rep:AuthorizableFolder]: Node type does not allow arbitrary child nodes and does not allow this specific name and node type either!", filePath=jcr_root/.../parent/child, nodePath=.../parent/child, line=7, column=6
> {code}
> when validating the child folder.
> Concrete use case https://github.com/Netcentric/accesscontroltool/tree/develop/accesscontroltool-content-package/src/main/jcr_root/home/users/system/actool/actool-service



--
This message was sent by Atlassian Jira
(v8.3.4#803005)