Node-Casbin authorization example for Nest.js via auth middleware: https://github.com/node-casbin/nest-authz

Clone this repo:
  1. f1834ec feat: fix model.conf and policy.csv mismatches (#21) by Copilot · 6 months ago master
  2. 7778fd4 feat(refactor): upgrade deps and add example (#18) by Guo Mingkai · 6 months ago
  3. 45b03e6 feat: use different user IDs (#16) by wujingquan · 6 months ago
  4. 791167c Merge pull request #15 from pranavsharma1029/import-fix by Guo Mingkai · 3 years, 11 months ago
  5. 082376a fix(app.module.ts): module import fix by Pranav Sharma · 4 years, 1 month ago

nest-authz-example

Commitizen friendly

Description

A demo shows how to use nest-authz to implement role-based access control.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Open http://localhost:3000/api to see api. The api uses Bear auth schema, so if you want to access protected api, you should click the Authorize button and set Bearer yourjwttoken after login.

Test

# unit tests
$ npm run test

License

MIT licensed.