// traverse the tree below groups-path and collect membership manually.
log.info("Traversing groups tree to collect membership.");
ItemVisitor visitor = new TraversingItemVisitor.Default() {
@Override
protected void entering(Property property, int level) throws RepositoryException {
PropertyImpl pMember = (PropertyImpl) property;
NodeImpl nGroup = (NodeImpl) pMember.getParent();
if (P_MEMBERS.equals(pMember.getQName()) && nGroup.isNodeType(NT_REP_GROUP)) {
// Found membership information in members property
for (Value value : property.getValues()) {
String v = value.getString();
if (v.equals(authorizableNodeIdentifier)) {
pIds.add(nGroup.getIdentifier());
}
}
} else {
// Found membership information in members node
while (nGroup.isNodeType(NT_REP_MEMBERS)) {
nGroup = (NodeImpl) nGroup.getParent();
}
if (nGroup.isNodeType(NT_REP_GROUP) && !NameConstants.JCR_UUID.equals(pMember.getQName())) {
String v = pMember.getString();
if (v.equals(authorizableNodeIdentifier)) {
nIds.add(nGroup.getIdentifier());
}
}
}