code: def unauthorized_view(self):
          
          # Prepare Flash message
          url = request.script_root + request.path
          flash(_("You do not have permission to access '%(url)s'.", url=url), 'error')
  
          # Redirect to USER_UNAUTHORIZED_ENDPOINT
          return redirect(self._endpoint_url(self.USER_UNAUTHORIZED_ENDPOINT))
docs: Prepare a Flash message and redirect to USER_UNAUTHORIZED_ENDPOINT