docs: function isRoleAllowed (allow, roles, rules, matched, ruleType, auditData) {
      // get length of roles for iteration
      var rolesLen = roles.length
      // check if user has any role that allows access
      for (var i=0; i < rolesLen; i++) {
          // if session has role that allows access then this overrides whatever
          // the previous value of allow was and any deny rule on all
          if (rules[roles[i]] === 1) {
              // build audit record
              var auditRule = {
                  allow: true,
                  role: roles[i],
                  ruleType: ruleType,
                  rules: rules,
              }
              // add additional audit data if any
              if (defined(auditData)) {
                  _.merge(auditRule, auditData)
              }
              // store audit record
              this.audit.setRule(auditRule)
              // access is allowed
              return true
          }
      }
      // if there is a deny rule for all and there was no specific allow rule
      // then access is denied
      if (rules.all === 0) {
          // build audit record
          var auditRule = {
              allow: false,
              role: 'all',
              ruleType: ruleType,
              rules: rules,
          }
          // add additional audit data if any
          if (defined(auditData)) {
              _.merge(auditRule, auditData)
          }
          // store audit record
          this.audit.setRule(auditRule)
          // access is denied
          return false
      }
      // build audit record
      var auditRule = {
          matched: false,
          ruleType: ruleType,
          rules: rules,
      }
      // add additional audit data if any
      if (defined(auditData)) {
          _.merge(auditRule, auditData)
      }
      // store audit record
      this.audit.setRule(auditRule)
      // return previous allow value or undefined if matched flag set
      return matched ? undefined : allow
  }