Evaluates a policy for a given resource and returns the policy result.
#include "am_policy.h" AM_EXPORT am_status_t am_policy_evaluate(am_policy_t policy_handle, const char *sso_token, const char *resource_name, const char *action_name, const am_map_t env_parameter_map, am_map_t policy_response_map_ptr, am_policy_result_t *policy_result);
This function takes the following parameters:
Opaque handle to the policy service created by policy_service_init .
User’s SSO token to be used for evaluation.
Name of resource to evaluate.
User’s access action, such as GET or POST.
Any environment variables to be used for evaluation.
Map to store user attributes from the policy evaluation call.
Evaluation results.
This function returns am_status_t with one of the following values:
If the call was successful.
If any error occurs, the type of error indicated by the status value.
This function destroys a policy service instance. Memory Concerns: After using the results the caller must call am_policy_result_destroy on the policy_result to cleanup the memory allocated by the evaluation operation. am_map_destroy must also be called on response and env_parameter_map after their respective usage scope.