code: def has_permission(
      permission,
      context=None,
  ):
      
      def wrapper(fn):
          @wraps(fn)
          async def wrapped(*args, **kwargs):
              request = args[-1]
              if not isinstance(request, web.BaseRequest):
                  msg = ("Incorrect decorator usage. "
                         "Expecting `def handler(request)` "
                         "or `def handler(self, request)`.")
                  raise RuntimeError(msg)
  
              await check_permission(request, permission, context)
              return await fn(*args, **kwargs)
  
          return wrapped
  
      warnings.warn("has_permission decorator is deprecated, "
                    "use check_permission instead",
                    DeprecationWarning)
      return wrapper
docs: Decorator that restricts access only for authorized users
      with correct permissions.
  
      If user is not authorized - raises HTTPUnauthorized,
      if user is authorized and does not have permission -
      raises HTTPForbidden.