OpenAuth_server/src/models/grants.ts

26 lines
566 B
TypeScript
Raw Normal View History

2020-03-17 15:27:57 +00:00
import DB from "../database";
import { ModelDataBase } from "@hibas123/safe_mongo/lib/model";
import { ObjectID } from "mongodb";
export interface IGrant extends ModelDataBase {
user: ObjectID;
client: ObjectID;
permissions: ObjectID[];
}
const Grant = DB.addModel<IGrant>({
name: "grant",
2020-08-07 14:16:39 +00:00
versions: [
{
migration: () => {},
schema: {
user: { type: ObjectID },
client: { type: ObjectID },
permissions: { type: ObjectID, array: true },
},
},
],
});
2020-03-17 15:27:57 +00:00
export default Grant;