function accessAllowed(req, user, trigger) {
  const role =
    req.user && req.user.id
      ? req.user.role_id
      : user && user.role_id
        ? user.role_id
        : 100;

  return role <= trigger.min_role;
}
Check that user has right to trigger call
@param {object} req httprequest
@param {object} user user based on access token
@param {Trigger} trigger
@returns {boolean}