2020-12-03 02:20:56 +13:00
|
|
|
const { BUILTIN_ROLE_IDS } = require("../utilities/security/roles")
|
2020-11-26 04:03:19 +13:00
|
|
|
|
2020-10-14 09:33:56 +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: {
|
|
|
|
username: {
|
|
|
|
type: "string",
|
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
length: {
|
|
|
|
maximum: "",
|
|
|
|
},
|
|
|
|
presence: true,
|
|
|
|
},
|
|
|
|
fieldName: "username",
|
|
|
|
name: "username",
|
|
|
|
},
|
2020-12-03 02:20:56 +13:00
|
|
|
roleId: {
|
|
|
|
fieldName: "roleId",
|
|
|
|
name: "roleId",
|
2020-11-26 04:03:19 +13:00
|
|
|
type: "options",
|
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
presence: false,
|
2020-12-03 02:20:56 +13:00
|
|
|
inclusion: Object.keys(BUILTIN_ROLE_IDS),
|
2020-11-26 04:03:19 +13:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
primaryDisplay: "username",
|
|
|
|
}
|
|
|
|
|
2020-10-14 09:33:56 +13:00
|
|
|
exports.AuthTypes = AuthTypes
|
2020-11-26 04:03:19 +13:00
|
|
|
exports.USERS_TABLE_SCHEMA = USERS_TABLE_SCHEMA
|