code: private List<CmsResource> filterPermissions(
          CmsDbContext dbc,
          List<CmsResource> resourceList,
          CmsResourceFilter filter)
      throws CmsException {
  
          if (filter.requireTimerange()) {
              // never check time range here - this must be done later in #updateContextDates(...)
              filter = filter.addExcludeTimerange();
          }
          ArrayList<CmsResource> result = new ArrayList<CmsResource>(resourceList.size());
          for (int i = 0; i < resourceList.size(); i++) {
              // check the permission of all resources
              CmsResource currentResource = resourceList.get(i);
              if (m_securityManager.hasPermissions(
                  dbc,
                  currentResource,
                  CmsPermissionSet.ACCESS_READ,
                  true,
                  filter).isAllowed()) {
                  // only return resources where permission was granted
                  result.add(currentResource);
              }
          }
          // return the result
          return result;
      }
docs: Filters the given list of resources, removes all resources where the current user
  does not have READ permissions, plus the filter is applied.<p>
  
  @param dbc the current database context
  @param resourceList a list of CmsResources
  @param filter the resource filter to use
  
  @return the filtered list of resources
  
  @throws CmsException in case errors testing the permissions