parameters: (cls)
return_statement: return True
docstring: This function gets registered under 'terminal' in the
      :attr:`ApplicationWebSocket.security` dict and is called by the
      :func:`require` decorator by way of the :class:`policies` sub-function. It
      returns True or False depending on what is defined in the settings dir and
      what function is being called.
  
      This function will keep track of and place limmits on the following:
  
          * The number of open terminals.
          * How big each terminal may be.
          * Who may view or write to a shared terminal.
  
      If no 'terminal' policies are defined this function will always return True.
docstring_summary: This function gets registered under 'terminal' in the
      :attr:`ApplicationWebSocket.security` dict and is called by the
      :func:`require` decorator by way of the :class:`policies` sub-function. It
      returns True or False depending on what is defined in the settings dir and
      what function is being called.
docstring_tokens: This function gets registered under terminal in the : attr : ApplicationWebSocket . security dict and is called by the : func : require decorator by way of the : class : policies sub - function . It returns True or False depending on what is defined in the settings dir and what function is being called .
function: def terminal_policies(cls):
      """
      This function gets registered under 'terminal' in the
      :attr:`ApplicationWebSocket.security` dict and is called by the
      :func:`require` decorator by way of the :class:`policies` sub-function. It
      returns True or False depending on what is defined in the settings dir and
      what function is being called.
  
      This function will keep track of and place limmits on the following:
  
          * The number of open terminals.
          * How big each terminal may be.
          * Who may view or write to a shared terminal.
  
      If no 'terminal' policies are defined this function will always return True.
      """
      instance = cls.instance # TerminalApplication instance
      function = cls.function # Wrapped function
      #f_args = cls.f_args     # Wrapped function's arguments
      #f_kwargs = cls.f_kwargs # Wrapped function's keyword arguments
      policy_functions = {
          'new_terminal': policy_new_terminal,
          'resize': policy_write_check_dict,
          'set_term_encoding': policy_write_check_dict,
          'set_term_keyboard_mode': policy_write_check_dict,
          'move_terminal': policy_write_check_dict,
          'kill_terminal': policy_write_check_arg,
          'reset_terminal': policy_write_check_arg,
          'manual_title': policy_write_check_dict,
          'share_terminal': policy_share_terminal,
          'char_handler': policy_char_handler
      }
      auth_log = instance.ws.auth_log
      user = instance.current_user
      policy = applicable_policies('terminal', user, instance.ws.prefs)
      if not policy: # Empty RUDict
          return True # A world without limits!
      # Start by determining if the user can even login to the terminal app
      if 'allow' in policy:
          if not policy['allow']:
              auth_log.error(_(
                  "%s denied access to the Terminal application by policy."
                  % user['upn']))
              return False
      if function.__name__ in policy_functions:
          return policy_functions[function.__name__](cls, policy)
      return True
function_tokens: def terminal_policies ( cls ) : instance = cls . instance # TerminalApplication instance function = cls . function # Wrapped function #f_args = cls.f_args     # Wrapped function's arguments #f_kwargs = cls.f_kwargs # Wrapped function's keyword arguments policy_functions = { 'new_terminal' : policy_new_terminal , 'resize' : policy_write_check_dict , 'set_term_encoding' : policy_write_check_dict , 'set_term_keyboard_mode' : policy_write_check_dict , 'move_terminal' : policy_write_check_dict , 'kill_terminal' : policy_write_check_arg , 'reset_terminal' : policy_write_check_arg , 'manual_title' : policy_write_check_dict , 'share_terminal' : policy_share_terminal , 'char_handler' : policy_char_handler } auth_log = instance . ws . auth_log user = instance . current_user policy = applicable_policies ( 'terminal' , user , instance . ws . prefs ) if not policy : # Empty RUDict return True # A world without limits! # Start by determining if the user can even login to the terminal app if 'allow' in policy : if not policy [ 'allow' ] : auth_log . error ( _ ( "%s denied access to the Terminal application by policy." % user [ 'upn' ] ) ) return False if function . __name__ in policy_functions : return policy_functions [ function . __name__ ] ( cls , policy ) return True