Files
worldshine-redesign/app/models/ext-usr-perm.model.js
Lixian Zhou dc158997ff
All checks were successful
Build And Deploy Main / build-and-deploy (push) Successful in 34s
fix
2026-03-16 16:16:22 -04:00

38 lines
813 B
JavaScript

module.exports = (mongoose) => {
const schema = mongoose.Schema(
{
external_user_id: {
type: String,
required: true
},
allow_site: {
type: Number,
required: true
},
username: String,
name: String,
title: String,
email: String,
permissions: [
{
type: String
}
],
create_by: String,
edit_by: String
},
{ collection: "ext_usr_perm", timestamps: true }
);
schema.method("toJSON", function () {
const { __v, _id, ...object } = this.toObject();
object.id = _id;
return object;
});
schema.index({ external_user_id: 1, allow_site: 1 }, { unique: true });
const ExtUserPermission = mongoose.model("ext_usr_perm", schema);
return ExtUserPermission;
};