old_contents: # -*- coding: utf-8 -*-
  
  from functools import wraps
  from flask import abort
  
  
  def admin_required(f):
      @wraps(f)
      def decorated_function(*args, **kwargs):
          from flask_login import current_user
          if not current_user.is_authenticated and not current_user.is_admin:
              abort(403)
          return f(*args, **kwargs)
      return decorated_function
  
new_contents: # -*- coding: utf-8 -*-
  
  from functools import wraps
  from flask import abort
  
  
  def admin_required(f):
      @wraps(f)
      def decorated_function(*args, **kwargs):
          from flask_login import current_user
          if not current_user.is_authenticated or not current_user.is_admin:
              abort(403)
          return f(*args, **kwargs)
      return decorated_function
  
subject: Abort when user is not authenticated or not an admin