Skip to content

Commit

Permalink
fix: update readme with new parameter and correct callback setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyskiep99 committed Feb 5, 2022
1 parent 66a03ad commit 7c19709
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Casbin role watcher to be used for monitoring updates to casbin policies
pip install casbin-postgresql-watcher
```

## Basic Usage Example
## Basic Usage Example
### With Flask-authz
```python
from flask_authz import CasbinEnforcer
Expand All @@ -22,7 +22,7 @@ from flask import Flask
from casbin.persist.adapters import FileAdapter

casbin_enforcer = CasbinEnforcer(app, adapter)
watcher = PostgresqlWatcher(host=HOST, port=PORT, user=USER, password=PASSWORD)
watcher.set_update_callback(casbin_enforcer.e.load_policy())
watcher = PostgresqlWatcher(host=HOST, port=PORT, user=USER, password=PASSWORD, dbname=DBNAME)
watcher.set_update_callback(casbin_enforcer.e.load_policy)
casbin_enforcer.set_watcher(watcher)
```
```

0 comments on commit 7c19709

Please sign in to comment.