code: def _is_whitelisted(self, req):
          
  
          if not self.roles_whitelist:
              return False
  
          if not hasattr(req, 'context'):
              self.log.info("No context found.")
              return False
  
          if not hasattr(req.context, 'roles'):
              self.log.info("No roles found in context")
              return False
  
          roles = req.context.roles
          self.log.debug("Received request from user with roles: %s",
                         ' '.join(roles))
          for key in self.roles_whitelist:
              if key in roles:
                  self.log.debug("User role (%s) is whitelisted.", key)
                  return True
  
          return False
docs: Return True if role is whitelisted or roles cannot be determined.