Sun Java System Access Manager 7 2005Q4 C API Reference

am_policy_evaluate()

Evaluates a policy for a given resource and returns the policy result.

Syntax

#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);

Parameters

This function takes the following parameters:

policy_handle

Opaque handle to the policy service created by policy_service_init .

sso_token

User’s SSO token to be used for evaluation.

resource_name

Name of resource to evaluate.

action_name

User’s access action, such as GET or POST.

env_parameter_map

Any environment variables to be used for evaluation.

policy_response_map_ptr

Map to store user attributes from the policy evaluation call.

policy_result

Evaluation results.

Returns

This function returns am_status_t with one of the following values:

AM_SUCCESS

If the call was successful.

AM_*

If any error occurs, the type of error indicated by the status value.

Details

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.