Search in sources :

Example 1 with FinancialSystemTransactionalDocumentAuthorizerBase

use of org.kuali.kfs.sys.document.authorization.FinancialSystemTransactionalDocumentAuthorizerBase in project cu-kfs by CU-CommunityApps.

the class CUFinancialSystemDocumentServiceImpl method setupFYIs.

protected void setupFYIs(Document doc, Set<Person> priorApprovers, String initiatorUserId) {
    List<AdHocRoutePerson> adHocRoutePersons = doc.getAdHocRoutePersons();
    final FinancialSystemTransactionalDocumentAuthorizerBase documentAuthorizer = getDocumentAuthorizer(doc);
    // Add FYI for each approver who has already approved the document
    for (Person approver : priorApprovers) {
        if (documentAuthorizer.canReceiveAdHoc(doc, approver, KewApiConstants.ACTION_REQUEST_FYI_REQ)) {
            String approverPersonUserId = approver.getPrincipalName();
            adHocRoutePersons.add(buildFyiRecipient(approverPersonUserId));
        }
    }
    // Add FYI for initiator
    adHocRoutePersons.add(buildFyiRecipient(initiatorUserId));
}
Also used : FinancialSystemTransactionalDocumentAuthorizerBase(org.kuali.kfs.sys.document.authorization.FinancialSystemTransactionalDocumentAuthorizerBase) AdHocRoutePerson(org.kuali.kfs.krad.bo.AdHocRoutePerson) AdHocRoutePerson(org.kuali.kfs.krad.bo.AdHocRoutePerson) Person(org.kuali.rice.kim.api.identity.Person)

Example 2 with FinancialSystemTransactionalDocumentAuthorizerBase

use of org.kuali.kfs.sys.document.authorization.FinancialSystemTransactionalDocumentAuthorizerBase in project cu-kfs by CU-CommunityApps.

the class CUFinancialSystemDocumentServiceImpl method getDocumentAuthorizer.

protected FinancialSystemTransactionalDocumentAuthorizerBase getDocumentAuthorizer(Document doc) {
    DataDictionaryService dataDictionaryService = SpringContext.getBean(DataDictionaryService.class);
    final String docTypeName = dataDictionaryService.getDocumentTypeNameByClass(doc.getClass());
    Class<? extends DocumentAuthorizer> documentAuthorizerClass = (Class<? extends DocumentAuthorizer>) dataDictionaryService.getDataDictionary().getDocumentEntry(docTypeName).getDocumentAuthorizerClass();
    FinancialSystemTransactionalDocumentAuthorizerBase documentAuthorizer = null;
    try {
        documentAuthorizer = (FinancialSystemTransactionalDocumentAuthorizerBase) documentAuthorizerClass.newInstance();
    } catch (InstantiationException ie) {
        throw new RuntimeException("Could not construct document authorizer: " + documentAuthorizerClass.getName(), ie);
    } catch (IllegalAccessException iae) {
        throw new RuntimeException("Could not construct document authorizer: " + documentAuthorizerClass.getName(), iae);
    }
    return documentAuthorizer;
}
Also used : FinancialSystemTransactionalDocumentAuthorizerBase(org.kuali.kfs.sys.document.authorization.FinancialSystemTransactionalDocumentAuthorizerBase) DocumentAuthorizer(org.kuali.kfs.kns.document.authorization.DocumentAuthorizer) DataDictionaryService(org.kuali.kfs.kns.service.DataDictionaryService)

Aggregations

FinancialSystemTransactionalDocumentAuthorizerBase (org.kuali.kfs.sys.document.authorization.FinancialSystemTransactionalDocumentAuthorizerBase)2 DocumentAuthorizer (org.kuali.kfs.kns.document.authorization.DocumentAuthorizer)1 DataDictionaryService (org.kuali.kfs.kns.service.DataDictionaryService)1 AdHocRoutePerson (org.kuali.kfs.krad.bo.AdHocRoutePerson)1 Person (org.kuali.rice.kim.api.identity.Person)1