code: function authorize(req, res, next) {
    const role = findRoleFromRequest(
      req,
      options.roleSearchPath,
      options.defaultRole,
      options.decodedObjectName
    );
  
    if (req.originalUrl === '/') {
      return next();
    }
  
    const policy = options.policies.get(role);
  
    if (!policy) {
      return res.status(403).json({
        status: 'Access denied',
        success: false,
        message: `REQUIRED: Policy for role ${role} is not defined`
      });
    }
  
    const permission = findPermissionForRoute(
      req.originalUrl,
      req.method,
      options.baseUrl,
      policy
    );
  
    if (!permission) {
      if (typeof options.denyCallback === 'function') {
        return options.denyCallback(res);
      }
      return res.status(403).json(deny(options.customMessage, options.response));
    }
  
    return checkIfHasAccess(
      req.method,
      res,
      next,
      permission,
      options.customMessage,
      options.response,
      options.denyCallback
    );
  }
docs: [authorize Express middleware]
  @param  {[type]}   req  [Th request object]
  @param  {[type]}   res  [The response object]
  @param  {Function} next [description]
  @return {[type]}        [description]