middleware/enforcer.js
function Enforcer (keycloak, config) {
  this.keycloak = keycloak;
  this.config = config || {};

  if (!this.config.response_mode) {
    this.config.response_mode = 'permissions';
  }

  if (!this.config.resource_server_id) {
    this.config.resource_server_id = this.keycloak.getConfig().clientId;
  }
}
function Enforcer (keycloak, config) {
  this.keycloak = keycloak;
  this.config = config || {};

  if (!this.config.response_mode) {
    this.config.response_mode = 'permissions';
  }

  if (!this.config.resource_server_id) {
    this.config.resource_server_id = this.keycloak.getConfig().clientId;
  }
}
Construct a policy enforcer.

@param {Config} config Config object.

@constructor