2020-11-25 16:03:19 +01:00
|
|
|
const { BUILTIN_LEVEL_IDS } = require("../utilities/security/accessLevels")
|
|
|
|
|
2020-10-13 22:33:56 +02:00
|
|
|
const AuthTypes = {
|
|
|
|
APP: "app",
|
|
|
|
BUILDER: "builder",
|
|
|
|
EXTERNAL: "external",
|
|
|
|
}
|
|
|
|
|
2020-11-25 16:03:19 +01: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",
|
|
|
|
},
|
|
|
|
accessLevelId: {
|
|
|
|
fieldName: "accessLevelId",
|
|
|
|
name: "accessLevelId",
|
|
|
|
type: "options",
|
|
|
|
constraints: {
|
|
|
|
type: "string",
|
|
|
|
presence: false,
|
|
|
|
inclusion: Object.keys(BUILTIN_LEVEL_IDS),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
primaryDisplay: "username",
|
|
|
|
}
|
|
|
|
|
2020-10-13 22:33:56 +02:00
|
|
|
exports.AuthTypes = AuthTypes
|
2020-11-25 16:03:19 +01:00
|
|
|
exports.USERS_TABLE_SCHEMA = USERS_TABLE_SCHEMA
|