-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Add injectArgs
option to @can
directive to pass along client defined arguments to the policy check
#1043
Conversation
Can you clarify the semantics of what happens if the statically defined |
If I understand it right, it can not collide. |
Discussion aside, should we have the argument args? So far I can see it is always an array of hardcoded strings. It doesn't have too much sense... |
I am not planning to make a new major version with breaking changes soon. Adding static values can be useful. The directive definition does lie a bit, actually you can pass a map as well, e.g.: I think it makes sense to prefer the static values, since that makes it more predictable that those are always passed and allows overwriting client given values for certain scenarios. Doing it the other way around is basically the same as setting default values, which is already possible in the argument definition itself. |
Ok, so we need to keep the args as it is right now. |
I did not realize that it is possible to just pass multiple arguments to the checks. That means we do not have to merge, nice. @faiverson had a pass over the PR, let me know if the changes are fine. |
injectArgs
option to @can
directive to pass along client defined arguments to the policy check
Resolves #1002
Changes
Added a new argument to avoid breaking changes with the current version.
Saying that I think
args
(getAdditionalArguments) is always a plain string, it doesn't have to much sense to me