Hierarchy functions
-------------------



.. index:: Macro function;fn.hierarchy

* *fn.hierarchy*: Return the UUID of the current node.         

.. index:: Macro function;fn.hierarchy_parent

* *fn.hierarchy_parent*: Return the UUID of the parent.               

.. index:: Macro function;fn.hierarchy_path

* *fn.hierarchy_path*: Return the current node hierarchy as a       
  list of UUIDs.                               

.. index:: Macro function;fn.hierarchy_parent_path

* *fn.hierarchy_parent_path*:  Return the current node parent hierarchy     
  as a list of UUIDs.                          

.. index:: Macro function;fn.hierarchy_friendly_path

* *fn.hierarchy_friendly_path*: Return the current node hierarchy as a       
  dot-separated hierarchy string.              

.. index:: Macro function;fn.hierarchy_friendly_parent_path

* *fn.hierarchy_friendly_parent_path*: Return the current node parent hierarchy     
  as a dot-separated hierarchy string.         

.. index:: Macro function;fn.friendly_path_choices

* *fn.friendly_path_choices*: Return a sorted list of friendly hierarchy paths.
  Used with a parameter:

  * ``down``: all hierarchies paths below, including current hierarchy path
  * ``below``: all hierarchies below current hierarchy path, excluding current hierarchy path
  * ``local``: current hierarchy path



.. index:: Macro function;fn.is_site

* *fn.is_site*: Return true or false if run at site context hierarchy or not.


.. index:: Macro function;fn.authorized_admin_allowed_hierarchy_level

* *fn.authorized_admin_allowed_hierarchy_level*: Given a hierarchy node type parameter,
  evaluates to ``true`` or ``false`` in accordance with the user's authorized admin hierarchy 
  role permissions to the hierarchy node type.  Refer to the Authorized Admin Hierarchy Roles
  topic in the Core Feature Guide.

  The hierarchy node type parameter value can be:

  * ``Customer``
  * ``Hcs``
  * ``IntermediateNode``
  * ``Provider``
  * ``Reseller``
  * ``Site``

  The ``LinkedSite`` node type is included in the ``Site`` node type parameter.





Examples:

.. tabularcolumns:: |p{8cm}|p{7cm}|

+-----------------------------------------------------+-------------------------------------------------+
| Example                                             | Output                                          |
+=====================================================+=================================================+
| ::                                                  | ::                                              |
|                                                     |                                                 |
|    {{fn.hierarchy}}                                 |    '52162d552afa433946245bcb'                   |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+
| ::                                                  | ::                                              |
|                                                     |                                                 |
|    {{fn.hierarchy_parent}}                          |    '52162d522afa433941245ba0'                   |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+
| ::                                                  | ::                                              |
|                                                     |                                                 |
|    {{fn.hierarchy_path}}                            |    ['1c0efeg2c0deab10da595101',                 |
|                                                     |    '52162d4c2afa433940245ba3',                  |
|                                                     |    '52162d4e2afa43393b245ba2',                  |
|                                                     |    '52162d522afa433941245ba0',                  |
|                                                     |    '52162d552afa433946245bcb']                  |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+
| ::                                                  | ::                                              |
|                                                     |                                                 |
|    {{fn.hierarchy_parent_path}}                     |    ['1c0efeg2c0deab10da595101',                 |
|                                                     |    '52162d4c2afa433940245ba3',                  |
|                                                     |    '52162d4e2afa43393b245ba2',                  |
|                                                     |    '52162d522afa433941245ba0']                  |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+
| ::                                                  | ::                                              |
|                                                     |                                                 |
|    {{fn.hierarchy_friendly_path}}                   |    'sys.GenCorp.SuperCom.ABCGroup.              |
|                                                     |     Branch1'                                    |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+
| ::                                                  | ::                                              |
|                                                     |                                                 |
|    {{fn.hierarchy_friendly_parent_path}}            |    'sys.GenCorp.SuperCom.ABCGroup'              |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+
| Hierarchy =                                         |                                                 |
|                                                     | ::                                              |
|                                                     |                                                 |
|  ``sys.hcs.CS-P.CS-NB.AAAGlobal``                   |                                                 |
|                                                     |    [                                            |
| ::                                                  |      "sys.hcs.CS-P.CS-NB.AAAGlobal",            |
|                                                     |      "sys.hcs.CS-P.CS-NB.AAAGlobal.LOC001",     |
|    {# fn.friendly_path_choices ,down #}             |      "sys.hcs.CS-P.CS-NB.AAAGlobal.LOC002",     |
|                                                     |      "sys.hcs.CS-P.CS-NB.AAAGlobal.LOC003",     |
|                                                     |      "sys.hcs.CS-P.CS-NB.AAAGlobal.LOC004",     |
|                                                     |      "sys.hcs.CS-P.CS-NB.AAAGlobal.LOC005",     |
|                                                     |      "sys.hcs.CS-P.CS-NB.AAAGlobal.LOCALIZE001" |
|                                                     |    ]                                            |
|                                                     |                                                 |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+
| Hierarchy =                                         |                                                 |
|                                                     |                                                 |
|                                                     |                                                 |
|  ``sys.hcs.CS-P.CS-NB.AAAGlobal`` (cust)            |                                                 |
|                                                     |                                                 |
| ::                                                  |  ::                                             |
|                                                     |                                                 |
|    {{ fn.is_site }}                                 |     false                                       |
|                                                     |                                                 |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+
| Can be added as menu or dashboard item condition    |                                                 |
| to hide the item is ``false``.                      |                                                 |
|                                                     |                                                 |
| ::                                                  | ::                                              |
|                                                     |                                                 |
|    (( fn.authorized_admin_allowed_hierarchy_level \ |    true                                         |
|       Customer == fn.true ))                        |                                                 |
|                                                     |                                                 |
+-----------------------------------------------------+-------------------------------------------------+


.. |VOSS Automate| replace:: VOSS Automate
.. |Unified CM| replace:: Unified CM
