addPolicy(name, parent) {
    name = name.trim();
    if (!name) {
      throw new Error('You must provide a valid policy name');
    }
    if (!parent) {
      throw new Error('You must provide a policy parent');
    }
    if (this._policies.list.includes(name)) {
      throw new Error(`The policy "${name}" already exists.`);
    }
    if (!this._policies.list.includes(parent)) {
      throw new Error(`The parent policy "${parent}" do not exist.`);
    }

    this._policies.tree[parent][name] = {};
    this._init();
  }
/**
   * Add a policy to the policies
   * @param name
   * @param parent
   */
Add a policy to the policies
@param name
@param parent
Add a policy to the policies @param name @param parent
addPolicy(name, parent) {
    name = name.trim();
    if (!name) {
      throw new Error('You must provide a valid policy name');
    }
    if (!parent) {
      throw new Error('You must provide a policy parent');
    }
    if (this._policies.list.includes(name)) {
      throw new Error(`The policy "${name}" already exists.`);
    }
    if (!this._policies.list.includes(parent)) {
      throw new Error(`The parent policy "${parent}" do not exist.`);
    }
    this._policies.tree[parent][name] = {};
    this._init();
  }
addPolicy ( name , parent ) { name = name . trim ( ) ; if ( ! name ) { throw new Error ( 'You must provide a valid policy name' ) ; } if ( ! parent ) { throw new Error ( 'You must provide a policy parent' ) ; } if ( this . _policies . list . includes ( name ) ) { throw new Error ( ` ${ name } ` ) ; } if ( ! this . _policies . list . includes ( parent ) ) { throw new Error ( ` ${ parent } ` ) ; } this . _policies . tree [ parent ] [ name ] = { } ; this . _init ( ) ; }
Add a policy to the policies
 @param name
 @param parent
Add a policy to the policies @param name @param parent