Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable verbose logging/debug with relevantRuleFor #34

Open
robbyphillips opened this issue Jun 3, 2021 · 1 comment
Open

Enable verbose logging/debug with relevantRuleFor #34

robbyphillips opened this issue Jun 3, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@robbyphillips
Copy link

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

  1. Attach data to the Forbidden error when something like authorize({ relevantRule: true })
  2. Use something like the debug library and just print the info when an environment variable is set. I think feathers core does this.
  3. 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.

@fratzinger
Copy link
Owner

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! 👍

@fratzinger fratzinger added enhancement New feature or request help wanted Extra attention is needed labels Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants