-
Notifications
You must be signed in to change notification settings - Fork 142
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
Predicates do not include the tested permission in the context #44
Comments
I am working on some small changes which will make predicates support |
This sounds like something useful to have in rules. The clean way to do it is change Predicate.test() to accept the rule as the first argument. This will be a breaking change, so it must come with a major version bump, but I expect impact to be low since probably noone uses this method directly. |
I just ran into an issue like this, too. I tried to work around it by partially-applying the rule to the predicate function before wrapping it in |
Hey @jonathanpglick can you try the context-rule-name branch and see if that works for you? This is WIP, feedback is welcome. |
I'm implementing a custom rule system where a user can have different answers to a permission depending on the
obj
that is supplied to the predicates. In order to check these permissions fully, I need access to the name of the rule being checked in my predicates.Is this possible without making
obj
in my predicates a tuple containing the name as well as the object I want to check on?The text was updated successfully, but these errors were encountered: