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));
}
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;
}
Aggregations