parameters: (cls, policy)
return_statement: return policy.get('send_user_messages', True)
docstring: Called by :func:`gateone_policies`, returns True if the user is
      authorized to send messages to other users and if applicable, all users
      (broadcasts).
docstring_summary: Called by :func:`gateone_policies`, returns True if the user is
      authorized to send messages to other users and if applicable, all users
      (broadcasts).
docstring_tokens: Called by : func : gateone_policies returns True if the user is authorized to send messages to other users and if applicable all users ( broadcasts ) .
function: def policy_send_user_message(cls, policy):
      """
      Called by :func:`gateone_policies`, returns True if the user is
      authorized to send messages to other users and if applicable, all users
      (broadcasts).
      """
      error_msg = _("You do not have permission to send messages to %s.")
      try:
          upn = cls.f_args[0]['upn']
      except (KeyError, IndexError):
          # send_user_message got bad *settings*.  Deny
          return False
      # TODO: Add a mechanism that allows users to mute other users here.
      if upn == 'AUTHENTICATED':
          cls.error = error_msg % "all users at once"
      else:
          cls.error = error_msg % upn
      return policy.get('send_user_messages', True)
function_tokens: def policy_send_user_message ( cls , policy ) : error_msg = _ ( "You do not have permission to send messages to %s." ) try : upn = cls . f_args [ 0 ] [ 'upn' ] except ( KeyError , IndexError ) : # send_user_message got bad *settings*.  Deny return False # TODO: Add a mechanism that allows users to mute other users here. if upn == 'AUTHENTICATED' : cls . error = error_msg % "all users at once" else : cls . error = error_msg % upn return policy . get ( 'send_user_messages' , True )