Call another rego policy with changing input #294
Unanswered
KellyZhou35
asked this question in
OPA and Rego
Replies: 1 comment 9 replies
-
Hi there! You can depend on rules from other policies either by importing them. If you want to modify the import data.helper
permissionSet := helper.allow_access with input as {"id": "foobar"}
# or keep the original input while modifying only some attributes
permissionSet := helper.allow_access with input.id as "foo" with input.bar as "baz" Btw, there's no need to |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm pretty new to OPA and rego language, recently I'm working on creating policies to evaluation if a user have access to certain data in our system.
I met following question: how can I call another rego policy with changing input?
For example:
Helper function:
Main evaluation policy:
and my evaluation call would be http://localhost:8181/v1/policies/evaluation
Currently I'm trying to put helper policy as a function in evalution policy but I don't think this is extendable as putting them in separate rego files.
Any suggestion would be appreciated, thanks!
Beta Was this translation helpful? Give feedback.
All reactions