How to get a specific action for the given rule based on the input resource, input action and the user accessible actions based on the roles defined. #411
-
Hello Everyone, I have a situation where i would like to get a response based on the action and the resource. I am not able to match a specific response action for the response that is structure. For more details i have attached the playground link which i have used to test the rule. Below is the more details about the requirement. When a user makes a call to get a product price for a specific product.
Assuming the below are the list of decisions a user can perform based on the roles assigned for the user.
I would now like to compare each decision with the input requested and return an exact match for the user from a data source.
Below is the current logic in have to get the response from the rule.
Expected Output:
Actual Response:The current response is matching all the resources with a wild card. Reference:
NOTE: It would be of great help if it is possible for me to understand if we can get the response action directly outside the object as mentioned below.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Is the primary problem that you want to return a single value for |
Beta Was this translation helpful? Give feedback.
-
Regarding your note at the end: the provided json isn't valid, but do you mean that you want to "unwrap" |
Beta Was this translation helpful? Give feedback.
Regarding your note at the end: the provided json isn't valid, but do you mean that you want to "unwrap"
resource_action_response
from the matching resource action and assign it toexpected_action_on_resource_action
?E.g.: https://play.openpolicyagent.org/p/ESZX0f0CCe