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

  return (
    role <= table.min_role_write ||
    ((req.user?.id || user?.id) &&
      (table.ownership_field_id || table.ownership_formula))
  );
}
Check that user has right to write table data (create, update, delete in terms of  CRUD)
@param {object} req httprequest
@param {object} user user based on access token
@param {Table} table
@returns {boolean}