-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Lazy Pattern #294
Comments
Hi, Thanks for the issue! Not sure that I correctly understand the usecase but you can already do this. CASL evaluates conditions lazily at the moment when you call If you want to define async conditions, then this is not available for now and probably won't be implemented. You can find reasons and alternatives in #160 . Someday I plan to put this in a cookbook section. Not sure what you expect from Does it make sense or you have something else in mind? |
@stalniy , it's exactly that bit (the Customize Ability section), I did miss it. |
Cool! So, can we close the issue? |
Yes, please do. |
Hi,
Consider the following simple case:
It would be nice to specify all the possible rules as above but let CASL executing them lazily in case we use a function as parameter instead of a json.
Is there a way to define several complex rules avoiding unwanted code execution?
Something like:
Is there any specific known pattern to handle similar cases using CASL (in my case the mongoose package)? Would it make sense as a feature?
Thanks
The text was updated successfully, but these errors were encountered: