1
0
Fork 0
mirror of synced 2024-07-03 13:30:46 +12:00
budibase/packages/server/src/constants/index.js

44 lines
834 B
JavaScript
Raw Normal View History

const { BUILTIN_ROLE_IDS } = require("../utilities/security/roles")
2020-11-26 04:03:19 +13:00
const AuthTypes = {
APP: "app",
BUILDER: "builder",
EXTERNAL: "external",
}
2020-11-26 04:03:19 +13:00
const USERS_TABLE_SCHEMA = {
_id: "ta_users",
type: "table",
views: {},
name: "Users",
schema: {
2020-12-05 01:22:45 +13:00
email: {
2020-11-26 04:03:19 +13:00
type: "string",
constraints: {
type: "string",
2020-12-05 01:22:45 +13:00
email: true,
2020-11-26 04:03:19 +13:00
length: {
maximum: "",
},
presence: true,
},
2020-12-05 01:22:45 +13:00
fieldName: "email",
name: "email",
2020-11-26 04:03:19 +13:00
},
roleId: {
fieldName: "roleId",
name: "roleId",
2020-11-26 04:03:19 +13:00
type: "options",
constraints: {
type: "string",
presence: false,
inclusion: Object.keys(BUILTIN_ROLE_IDS),
2020-11-26 04:03:19 +13:00
},
},
},
2020-12-05 01:22:45 +13:00
primaryDisplay: "email",
2020-11-26 04:03:19 +13:00
}
exports.AuthTypes = AuthTypes
2020-11-26 04:03:19 +13:00
exports.USERS_TABLE_SCHEMA = USERS_TABLE_SCHEMA