private List<CatalogCategory> filterCategoriesByACLs(List<CatalogCategory> categories){
  List<CatalogCategory> filteredCatalogCategories=Lists.newArrayList();
  StorageOSUser storageOSUser=getUserFromContext();
  String username=storageOSUser.getName();
  if (isAdministrator(storageOSUser)) {
    log.debug(username + " has SystemAdmin or TenantAdmin Role, can view all categories.");
    filteredCatalogCategories.addAll(categories);
    return filteredCatalogCategories;
  }
  for (  CatalogCategory category : categories) {
    if (hasAccess(storageOSUser,category)) {
      filteredCatalogCategories.add(category);
    }
  }
  return filteredCatalogCategories;
}

private List < CatalogCategory > filterCategoriesByACLs ( List < CatalogCategory > categories ) { List < CatalogCategory > filteredCatalogCategories = Lists . newArrayList ( ) ; StorageOSUser storageOSUser = getUserFromContext ( ) ; String username = storageOSUser . getName ( ) ; if ( isAdministrator ( storageOSUser ) ) { log . debug ( username + " has SystemAdmin or TenantAdmin Role, can view all categories." ) ; filteredCatalogCategories . addAll ( categories ) ; return filteredCatalogCategories ; } for ( CatalogCategory category : categories ) { if ( hasAccess ( storageOSUser , category ) ) { filteredCatalogCategories . add ( category ) ; } } return filteredCatalogCategories ; }
filter out the categories which user don ' t have access to
