/** * Adding the role qualifications for the processing chart and organization * * @see * org.kuali.rice.kns.document.authorization.DocumentAuthorizerBase#addRoleQualification(org.kuali.rice.kns.bo.BusinessObject, * java.util.Map) */ @Override protected void addRoleQualification(Object businessObject, Map<String, String> attributes) { super.addRoleQualification(businessObject, attributes); if (businessObject != null && businessObject instanceof PaymentApplicationDocument) { final PaymentApplicationDocument document = (PaymentApplicationDocument) businessObject; final WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument(); if (workflowDocument.isInitiated() || workflowDocument.isSaved() || workflowDocument .isCompletionRequested()) { // only add processing chart and org if we're PreRoute final AccountsReceivableDocumentHeader arDocumentHeader = document.getAccountsReceivableDocumentHeader(); if (!ObjectUtils.isNull(arDocumentHeader)) { if (!StringUtils.isBlank(arDocumentHeader.getProcessingChartOfAccCodeAndOrgCode())) { attributes.put( KfsKimAttributes.CHART_OF_ACCOUNTS_CODE, arDocumentHeader.getProcessingChartOfAccountCode()); } if (!StringUtils.isBlank(arDocumentHeader.getProcessingOrganizationCode())) { attributes.put( KfsKimAttributes.ORGANIZATION_CODE, arDocumentHeader.getProcessingOrganizationCode()); } } } } }