* Gets a deny-biased policy set that includes all repository-wide and
* object-specific policies.
*/
@Override
public PolicyFinderResult findPolicy(EvaluationCtx context) {
PolicyFinderResult policyFinderResult = null;
try {
List<AbstractPolicy> policies = new ArrayList<AbstractPolicy>(m_repositoryPolicies);
String pid = getPid(context);
if (pid != null && !"".equals(pid)) {
AbstractPolicy objectPolicyFromObject =
m_policyLoader.loadObjectPolicy(m_policyParser.copy(),
pid,
m_validateObjectPoliciesFromDatastream);
if (objectPolicyFromObject != null) {
policies.add(objectPolicyFromObject);
}
}
PolicyCombiningAlgorithm policyCombiningAlgorithm =
(PolicyCombiningAlgorithm) Class
.forName(m_combiningAlgorithm).newInstance();
PolicySet policySet =
new PolicySet(new URI(""),
policyCombiningAlgorithm,
null /*
* no general target beyond those of
* multiplexed individual policies
*/,
policies);
policyFinderResult = new PolicyFinderResult(policySet);
} catch (Exception e) {
logger.warn("PolicyFinderModule seriously failed to evaluate a policy ", e);
policyFinderResult =
new PolicyFinderResult(new Status(ERROR_CODE_LIST, e
.getMessage()));
}
return policyFinderResult;
}