1
0
Fork 0
mirror of synced 2024-08-04 04:41:37 +12:00
budibase/packages/server/initialise/helpers.js
michael shanks 2fc0bc7156 mono repo
2019-06-07 14:18:10 +01:00

30 lines
712 B
JavaScript

const crypto = require("../nodeCrypto");
const {getDatabaseManager, getAppApis} = require("budibase-core");
module.exports.getApisWithFullAccess = async (datastore) => {
const bb = await getAppApis(
datastore,
null, null, null,
crypto
);
bb.withFullAccess();
return bb;
};
module.exports.getApisForUser = async (datastore, username, password) => {
const bb = await getAppApis(
datastore,
null, null, null,
crypto
);
await bb.authenticateAs(username, password);
return bb;
}
module.exports.getDatabaseManager = (datastoreModule, datastoreConfig) =>
getDatabaseManager(datastoreModule.databaseManager(datastoreConfig));