mirror of
https://github.com/gnmyt/LicenseAPI.git
synced 2026-01-11 18:51:47 +00:00
Create Permission.ts model
This commit is contained in:
24
src/models/Permission.ts
Normal file
24
src/models/Permission.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import {model, ObjectId, Schema} from "mongoose";
|
||||
|
||||
export interface IPermission {
|
||||
projectId: ObjectId,
|
||||
permission: string,
|
||||
description: string
|
||||
}
|
||||
|
||||
const PermissionSchema = new Schema<IPermission>({
|
||||
projectId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
permission: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: "No description provided"
|
||||
}
|
||||
});
|
||||
|
||||
export const Permission = model<IPermission>("permissions", PermissionSchema);
|
||||
Reference in New Issue
Block a user