@Override
public Source evaluate(Source request) {
RequestType requestType = requestSourceToRequestType(request);
XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
@SuppressWarnings("unchecked")
XACMLObjectBuilder<ResponseType> responseTypeBuilder =
(XACMLObjectBuilder<ResponseType>)
builderFactory.getBuilder(ResponseType.DEFAULT_ELEMENT_NAME);
@SuppressWarnings("unchecked")
XACMLObjectBuilder<ResultType> resultTypeBuilder =
(XACMLObjectBuilder<ResultType>)
builderFactory.getBuilder(ResultType.DEFAULT_ELEMENT_NAME);
@SuppressWarnings("unchecked")
XACMLObjectBuilder<DecisionType> decisionTypeBuilder =
(XACMLObjectBuilder<DecisionType>)
builderFactory.getBuilder(DecisionType.DEFAULT_ELEMENT_NAME);
@SuppressWarnings("unchecked")
XACMLObjectBuilder<StatusType> statusTypeBuilder =
(XACMLObjectBuilder<StatusType>)
builderFactory.getBuilder(StatusType.DEFAULT_ELEMENT_NAME);
@SuppressWarnings("unchecked")
XACMLObjectBuilder<StatusCodeType> statusCodeTypeBuilder =
(XACMLObjectBuilder<StatusCodeType>)
builderFactory.getBuilder(StatusCodeType.DEFAULT_ELEMENT_NAME);
DecisionType decisionType = decisionTypeBuilder.buildObject();
String role = getSubjectRole(requestType);
if ("manager".equals(role)) {