mongoose-isowner
Mongoose plugin for ownership determination by calling [Model].isOwner(doc, user)
Installation
npm install --save mongoose-isowner
Usage
const mongoose = const Schema = mongooseSchemaconst mongooseIsOwner = let YourSchema = title: String description: String author: String YourSchema let Model = mongoose
After setting up, you can call .isOwner(doc, user)
on your model which will determine if the user is the owner.
Model
License
The MIT License Copyright (c) Carsten Jacobsen