Created the Permission.ts model
This commit is contained in:
parent
f5403e77cd
commit
9af16f9160
24
src/models/Permission.ts
Normal file
24
src/models/Permission.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import {model, ObjectId, Schema, Types} from "mongoose";
|
||||
|
||||
export interface IPermission {
|
||||
projectId: ObjectId,
|
||||
permission: string,
|
||||
description: string
|
||||
}
|
||||
|
||||
const PermissionSchema = new Schema<IPermission>({
|
||||
projectId: {
|
||||
type: Types.ObjectId,
|
||||
required: true
|
||||
},
|
||||
permission: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: "Keine Beschreibung angegeben"
|
||||
}
|
||||
});
|
||||
|
||||
export const Permission = model<IPermission>('permissions', PermissionSchema);
|
Loading…
x
Reference in New Issue
Block a user