From Nuxeo DM using an sql database to store groups (not ldap), when adding a subgroup "subgroup" to a group "group", it is adding a entry in group2group table:
- subgroup as parentGroupId
- group as childGroupId
and should be - group as parentGroupId
- subgroup as childGroupId
The default contribution is not correct: (server/default/deploy/nuxeo.ear/config/default-sql-directories-bundle.xml)
<references> <tableReference field="members" directory="userDirectory" table="user2group" sourceColumn="groupId" targetColumn="userId" schema="user2group" dataFile="user2group.csv" /> <tableReference field="subGroups" directory="groupDirectory" table="group2group" sourceColumn="childGroupId" targetColumn="parentGroupId" schema="group2group" /> <inverseReference field="parentGroups" directory="groupDirectory" dualReferenceField="subGroups" /> </references>
where sourceColumn should be parentGroupId and targetColumn should be childGroupId
Upgrading from < 5.3.1, the fields need to be inverted in the table group2group (if using sql for groups). If the database modification is not done, parent groups will become child groups and child groups will become parent groups.