maybe_as_tenant = async (ten, f) => {
  if (!ten) return await f();
  const db = require("@saltcorn/data/db");
  if (ten === "*") {
    const { getAllTenants } = require("@saltcorn/admin-models/models/tenant");
    const tenants = await getAllTenants();

    for (const tenant of tenants) await db.runWithTenant(tenant, f);
  } else return await db.runWithTenant(ten, f);
}
Execute function for specified tenant
@param {object} ten - specified tenant
@param {function} f  - function
@returns {Promise<void>}