Description
During initialization, the policy engine sorts the policy evaluators such that the policies most likely to match many requests are evaluated at the top. To aid this ordering, a eval-score is computed for each policy based on the contents of the policy - like users/groups, accessTypes, resource-values, etc. However, this order may not be the most efficient for the access request pattern at runtime. It will help to reorder the policies dynamically based on the number of decisions made by each policy. For example, each time a policy determines the result of an access request, its hit-score should be incremented. Periodically the policies should be reordered to place policies that made most decisions at the top - so that fewer policies need to be evaluated to determine the access request.