setRole = async (req, res, model) => {
  const { id } = req.params;
  const role = (req.body || {}).role;
  await model.update(+id, { min_role: role });
  const page = model.findOne({ id });
  const roles = await User.get_roles();
  const roleRow = roles.find((r) => r.id === +role);
  const message =
    roleRow && page
      ? req.__(`Minimum role for %s updated to %s`, page.name, roleRow.role)
      : req.__(`Minimum role updated`);
  if (model.state_refresh) await model.state_refresh();
  if (!req.xhr) {
    req.flash("success", message);
    res.redirect("/pageedit");
  } else res.json({ okay: true, responseText: message });
}
set the minimum role for a model (Page, View, ...)
@param {any} req
@param {any} res
@param {any} model