hsluoyz commented on PR #551: URL: https://github.com/apache/casbin-node-casbin/pull/551#issuecomment-5207109149
Thanks for the contribution! A couple of things though: node-casbin doesn't host usage guides — all docs live in the casbin-website repo (casbin.apache.org/docs), so a `docs/` file here wouldn't be linked or discoverable. We also already have an official NestJS integration, nest-authz (https://github.com/apache/casbin-nest-authz) with a full example repo, so a guide should build on that rather than a hand-rolled guard. The example itself also has a few issues worth fixing first: the subject is hardcoded to `'alice'` instead of read from `request.user`, `request.url` includes the query string so `/data?page=1` won't match the `/data` policy (RESTful paths need `keyMatch2`), the enforcer is created in an async `onModuleInit` without `implements OnModuleInit` (racy — better to provide the `Enforcer` as a `useFactory` provider and inject it), and every code block is tagged ```bash even for TS/conf/csv. I'd suggest closing this and opening a PR against casbin-website instead. Thank s again! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
