UNPKG

egg-rbac-instance

Version:
17 lines (14 loc) 457 B
'use strict'; module.exports = (mongoose,db) => { const ObjectId = mongoose.Schema.ObjectId; const RoleSchema = new mongoose.Schema({ name: { type: String }, alias: { type: String }, grants: [{ type: ObjectId, ref: 'Permission' }], adpt: { type: Object }, isself: { type: Boolean }, create_at: { type: Date, default: Date.now }, update_at: { type: Date, default: Date.now }, }); return db.model('Role', RoleSchema); };