Search in sources :

Example 1 with SensitiveData

use of org.kuali.kfs.module.purap.businessobject.SensitiveData in project cu-kfs by CU-CommunityApps.

the class PurchasingAccountsPayableTransactionalDocumentAuthorizerBase method addRoleQualification.

@Override
protected void addRoleQualification(Object businessObject, Map<String, String> attributes) {
    super.addRoleQualification(businessObject, attributes);
    attributes.put(PurapKimAttributes.DOCUMENT_SENSITIVE, "false");
    PurchasingAccountsPayableDocument purapDoc = (PurchasingAccountsPayableDocument) businessObject;
    if (purapDoc.getAccountsPayablePurchasingDocumentLinkIdentifier() != null) {
        List<SensitiveData> sensitiveDataList = SpringContext.getBean(SensitiveDataService.class).getSensitiveDatasAssignedByRelatedDocId(purapDoc.getAccountsPayablePurchasingDocumentLinkIdentifier());
        if (ObjectUtils.isNotNull(sensitiveDataList) && !sensitiveDataList.isEmpty()) {
            StringBuffer sensitiveDataCodes = new StringBuffer();
            for (SensitiveData sensitiveData : sensitiveDataList) {
                if (ObjectUtils.isNotNull(sensitiveData)) {
                    sensitiveDataCodes.append(sensitiveData.getSensitiveDataCode()).append(";");
                }
            }
            if (sensitiveDataCodes.length() > 0) {
                attributes.put(PurapKimAttributes.DOCUMENT_SENSITIVE, "true");
                attributes.put(PurapKimAttributes.SENSITIVE_DATA_CODE, sensitiveDataCodes.toString().substring(0, sensitiveDataCodes.length() - 1));
                attributes.put(PurapKimAttributes.ACCOUNTS_PAYABLE_PURCHASING_DOCUMENT_LINK_IDENTIFIER, purapDoc.getAccountsPayablePurchasingDocumentLinkIdentifier().toString());
            }
        // KFSUPGRADE-346
        } else if (purapDoc.isSensitive()) {
            attributes.put(PurapKimAttributes.DOCUMENT_SENSITIVE, "true");
        }
    }
}
Also used : SensitiveDataService(org.kuali.kfs.module.purap.service.SensitiveDataService) SensitiveData(org.kuali.kfs.module.purap.businessobject.SensitiveData) PurchasingAccountsPayableDocument(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)

Aggregations

SensitiveData (org.kuali.kfs.module.purap.businessobject.SensitiveData)1 PurchasingAccountsPayableDocument (org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)1 SensitiveDataService (org.kuali.kfs.module.purap.service.SensitiveDataService)1