code: protected boolean hasReadPermission(CmsObject cms, I_CmsSearchDocument doc) {
  
          // If no permission check is needed: the document can be read
          // Else try to read the resource if this is not possible the user does not have enough permissions
          return !needsPermissionCheck(doc) ? true : (null != getResource(cms, doc));
      }
docs: Checks if the OpenCms resource referenced by the result document can be read
  be the user of the given OpenCms context.<p>
  
  @param cms the OpenCms user context to use for permission testing
  @param doc the search result document to check
  @return <code>true</code> if the user has read permissions to the resource