use of com.sun.identity.entitlement.xacml3.core.EffectType in project OpenAM by OpenRock.
the class XACMLPrivilegeUtils method getActionValuesFromPolicy.
static Map<String, Boolean> getActionValuesFromPolicy(Policy policy) {
if (policy == null) {
return null;
}
List<Rule> rules = getRules(policy);
if (rules == null) {
return null;
}
Map<String, Boolean> actionValues = new HashMap<String, Boolean>();
for (Rule rule : rules) {
Target target = rule.getTarget();
List<Match> matches = getAllMatchesFromTarget(target);
Set<String> actions = getActionNamesFromMatches(matches);
EffectType effectType = rule.getEffect();
for (String action : actions) {
actionValues.put(action, (EffectType.PERMIT == effectType) ? Boolean.TRUE : Boolean.FALSE);
}
}
return actionValues;
}
use of com.sun.identity.entitlement.xacml3.core.EffectType in project OpenAM by OpenRock.
the class XACMLSchemaFactoryTest method checkEqualAdviceExpressionValues.
/**
* Check that two advice expression objects contain the same values, return true if so, false otherwise.
* @param ae1 the first advice expression object
* @param ae2 the second advice expression object
* @return true if the advice expression objects contain the same values, false otherwise.
*/
private boolean checkEqualAdviceExpressionValues(final AdviceExpression ae1, final AdviceExpression ae2) {
if (ae1 == ae2) {
return true;
}
if (ae1 == null || ae2 == null) {
return false;
}
if (!compareStrings(ae1.getAdviceId(), ae2.getAdviceId())) {
return false;
}
EffectType effectType1 = ae1.getAppliesTo();
EffectType effectType2 = ae2.getAppliesTo();
if (effectType1 == null && effectType2 != null || effectType1 != null && effectType2 == null) {
return false;
}
if (effectType1 != null && effectType2 != null && !effectType1.equals(effectType2)) {
return false;
}
return (compareListsOfAttributeAssignmentExpression(ae1.getAttributeAssignmentExpression(), ae2.getAttributeAssignmentExpression()));
}
Aggregations