public attach()

in lib/util.ts [52:62]


  public attach(policy: IPolicy) {
    if (this.policies.find(p => p === policy)) {
      return; // already attached
    }

    if (this.policies.find(p => p.policyName === policy.policyName)) {
      throw new Error(`A policy named "${policy.policyName}" is already attached`);
    }

    this.policies.push(policy);
  }