code: def _apply_secure(self, func, permission=None):
          '''Enforce authentication on a given method/verb'''
          self._handle_api_doc(func, {'security': 'apikey'})
  
          @wraps(func)
          def wrapper(*args, **kwargs):
              if not current_user.is_authenticated:
                  self.abort(401)
  
              if permission is not None:
                  with permission.require():
                      return func(*args, **kwargs)
              else:
                  return func(*args, **kwargs)
  
          return wrappef _apply_secure(self, func, permission=None):
          '''Enforce authentication on a given method/verb'''
          self._handle_api_doc(func, {'security': 'apikey'})
  
          @wraps(func)
          def wrapper(*args, **kwargs):
              if not current_user.is_authenticated:
                  self.abort(401)
  
              if permission is not None:
                  with permission.require():
                      return func(*args, **kwargs)
              else:
                  return func(*args, **kwargs)
  
          return wrapper
docs: Enforce authentication on a given method/verb