docs: function isPathMatchSelector(path, selector){
    function isMatch(path, selector){
      path = typeof path == 'string' ? parseRole(path) : path || '';
      selector = typeof selector == 'string' ? parseRole(selector) : selector || '';
  
      return selector.role == path.role &&
             (selector.roleId == '*' || selector.roleId == path.roleId) &&
             selector.subrole == path.subrole;
    }
  
    var pathIndex = path.length;
    var selectorIndex = selector.length;
  
    if (!selectorIndex)
      return true;
  
    if (!isMatch(path[--pathIndex], selector[--selectorIndex]))
      return false;
  
    while (pathIndex > 0 && selectorIndex > 0)
      if (!isMatch(path[--pathIndex], selector[--selectorIndex]))
        selectorIndex++;
  
    return selectorIndex === 0;
  }