protected boolean objectVisibleToUser ( String objectTenancyPath , String userTenancyPath ) { // if in "same hierarchy" return objectTenancyPath . startsWith ( userTenancyPath ) || userTenancyPath . startsWith ( objectTenancyPath ) ; }
Protected visibility so can be overridden if required eg using wildcard matches .