{"repo":"apache/casbin-node-casbin-mongoose-adapter","free":true,"listed":false,"github":"https://github.com/apache/casbin-node-casbin-mongoose-adapter","clone":"git clone https://github.com/apache/casbin-node-casbin-mongoose-adapter.git","description":"Mongoose adapter for Casbin","language":"JavaScript","stars":37,"topics":["node-casbin","casbin","adapter","storage-driver","mongodb","mongoose","access-control","authorization"],"license":"Apache-2.0","category":"auth-billing-email","readme_excerpt":"Mongoose Adapter ==== [![NPM version][npm-image]][npm-url] [![NPM download][download-image]][download-url] [npm-image]: https://img.shields.io/npm/v/casbin-mongoose-adapter.svg?style=flat-square [npm-url]: https://npmjs.org/package/casbin-mongoose-adapter [download-image]: https://img.shields.io/npm/dm/casbin-mongoose-adapter.svg?style=flat-square [download-url]: https://npmjs.org/package/casbin-mongoose-adapter Mongoose Adapter is the Mongoose adapter for Node-Casbin. With this library, Node-Casbin can load policy from Mongoose supported database or save policy to it. It is originally developed by @ghaiklor from @elasticio. Based on Officially Supported Databases, The current supported database is MongoDB. Mongoose Adapter has been rewritten to TypeScript since v3.x. Getting Started Install the package as dependency in your project: Note : casbin as peerDependencies! Require it in a place, where you are instantiating an enforcer (read more about enforcer here): That is all what required for integrating the adapter into casbin. Casbin itself calls adapter methods to persist updates you made through it. Configuration You can pass mongooose-specific options when instantiating the adapter: Additional information regard to options you can pass in you can find in mongoose documentation Custom Collection Name By default, the adapter uses casbin rule as the collection name. You can customize this by passing a collectionName option in adapterOptions : This allows you to follow your o","default_branch":null,"files":null,"tree":[],"storefront":"/r/apache","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/apache/casbin-node-casbin-mongoose-adapter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}