feathers-casl
feathers-casl copied to clipboard
Enable verbose logging/debug with `relevantRuleFor`
It would really nice to optionally enable verbose logging using CASL's relevantRuleFor
feature. https://casl.js.org/v5/en/advanced/debugging-testing#debugging
I can think of three different ways that we might expose it
- Attach data to the
Forbidden
error when something likeauthorize({ relevantRule: true })
- Use something like the debug library and just print the info when an environment variable is set. I think feathers core does this.
- Give the necessary context to the
actionOnForbidden
callback and leave the logging to the library consumer.
What do you think? If any of these sound good, I would be willing to make a PR.
Hey @robbyphillips, sorry for the delay! Thanks for your issue and thoughts. I definitely would go for the debug library. I should use it for my libraries, I admit. A PR would be highly appreciated and merged soon. If you got time, please feel free to start with the branch: https://github.com/fratzinger/feathers-casl/tree/basic-permission-performant-select as I will merge it to master soon.
Many thanks in advance! 👍