1
0
Fork 0
mirror of synced 2024-10-01 09:38:55 +13:00
budibase/packages/server/src/constants/index.js
2020-12-08 12:20:37 +00:00

43 lines
836 B
JavaScript

const { BUILTIN_ROLE_IDS } = require("../utilities/security/roles")
const AuthTypes = {
APP: "app",
BUILDER: "builder",
EXTERNAL: "external",
}
const USERS_TABLE_SCHEMA = {
_id: "ta_users",
type: "table",
views: {},
name: "Users",
schema: {
email: {
type: "string",
constraints: {
type: "string",
email: true,
length: {
maximum: "",
},
presence: true,
},
fieldName: "email",
name: "email",
},
roleId: {
fieldName: "roleId",
name: "roleId",
type: "options",
constraints: {
type: "string",
presence: false,
inclusion: Object.values(BUILTIN_ROLE_IDS),
},
},
},
primaryDisplay: "email",
}
exports.AuthTypes = AuthTypes
exports.USERS_TABLE_SCHEMA = USERS_TABLE_SCHEMA