Skip to content

Commit

Permalink
chore: bump to v2.2.1
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
  • Loading branch information
nodece committed Aug 12, 2020
1 parent b583faf commit b7032e3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Implements a policy adapter for casbin with MongoDB support.
* [new MongooseAdapter(uri, [options])](#new_MongooseAdapter_new)
* _instance_
* [._open()](#MongooseAdapter+_open) ⇒ <code>Promise.&lt;void&gt;</code>
* [.setFiltered([filtered])](#MongooseAdapter+setFiltered)
* [.setFiltered([enable])](#MongooseAdapter+setFiltered)
* [.isFiltered()](#MongooseAdapter+isFiltered) ⇒ <code>boolean</code>
* [.setSynced([synced])](#MongooseAdapter+setSynced)
* [.setAutoAbort([abort])](#MongooseAdapter+setAutoAbort)
* [.setAutoCommit([commit])](#MongooseAdapter+setAutoCommit)
Expand Down Expand Up @@ -59,16 +60,22 @@ Opens a connection to mongoDB
**Kind**: instance method of [<code>MongooseAdapter</code>](#MongooseAdapter)
<a name="MongooseAdapter+setFiltered"></a>

### mongooseAdapter.setFiltered([isFiltered])
### mongooseAdapter.setFiltered([enable])
Switch adapter to (non)filtered state.
Casbin uses this flag to determine if it should load the whole policy from DB or not.

**Kind**: instance method of [<code>MongooseAdapter</code>](#MongooseAdapter)

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [isFiltered] | <code>Boolean</code> | <code>true</code> | Flag that represents the current state of adapter (filtered or not) |
| [enable] | <code>Boolean</code> | <code>true</code> | Flag that represents the current state of adapter (filtered or not) |

<a name="MongooseAdapter+isFiltered"></a>

### mongooseAdapter.isFiltered() ⇒ <code>boolean</code>
isFiltered determines whether the filtered model is enabled for the adapter.

**Kind**: instance method of [<code>MongooseAdapter</code>](#MongooseAdapter)
<a name="MongooseAdapter+setSynced"></a>

### mongooseAdapter.setSynced([synced])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "casbin-mongoose-adapter",
"version": "2.2.0",
"version": "2.2.1",
"description": "Mongoose adapter for Casbin",
"main": "src/adapter.js",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class MongooseAdapter {
* Switch adapter to (non)filtered state.
* Casbin uses this flag to determine if it should load the whole policy from DB or not.
*
* @param {Boolean} [isFiltered=true] Flag that represents the current state of adapter (filtered or not)
* @param {Boolean} [enable=true] Flag that represents the current state of adapter (filtered or not)
*/
setFiltered (enable = true) {
this.filtered = enable;
Expand Down

0 comments on commit b7032e3

Please sign in to comment.