use of org.kuali.kfs.kim.impl.identity.principal.Principal in project cu-kfs by CU-CommunityApps.
the class PermissionServiceImpl method logAuthorizationCheck.
protected void logAuthorizationCheck(String checkType, String principalId, String namespaceCode, String permissionName, Map<String, String> qualification) {
StringBuilder sb = new StringBuilder();
sb.append('\n');
sb.append("Is AuthZ for ").append(checkType).append(": ").append(namespaceCode).append("/").append(permissionName).append('\n');
sb.append(" Principal: ").append(principalId);
if (principalId != null) {
Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(principalId);
if (principal != null) {
sb.append(" (").append(principal.getPrincipalName()).append(')');
}
}
sb.append('\n');
sb.append(" Qualifiers:\n");
if (qualification != null && !qualification.isEmpty()) {
sb.append(qualification);
} else {
sb.append(" [null]\n");
}
if (LOG.isTraceEnabled()) {
LOG.trace(sb.append(ExceptionUtils.getStackTrace(new Throwable())));
} else {
LOG.debug(sb.toString());
}
}
use of org.kuali.kfs.kim.impl.identity.principal.Principal in project cu-kfs by CU-CommunityApps.
the class PermissionServiceImpl method logAuthorizationCheckByTemplate.
protected void logAuthorizationCheckByTemplate(String checkType, String principalId, String namespaceCode, String permissionName, Map<String, String> permissionDetails, Map<String, String> qualification) {
StringBuilder sb = new StringBuilder();
sb.append('\n');
sb.append("Is AuthZ for ").append(checkType).append(": ").append(namespaceCode).append("/").append(permissionName).append('\n');
sb.append(" Principal: ").append(principalId);
if (principalId != null) {
Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(principalId);
if (principal != null) {
sb.append(" (").append(principal.getPrincipalName()).append(')');
}
}
sb.append('\n');
sb.append(" Details:\n");
if (permissionDetails != null) {
sb.append(permissionDetails);
} else {
sb.append(" [null]\n");
}
sb.append(" Qualifiers:\n");
if (qualification != null && !qualification.isEmpty()) {
sb.append(qualification);
} else {
sb.append(" [null]\n");
}
if (LOG.isTraceEnabled()) {
LOG.trace(sb.append(ExceptionUtils.getStackTrace(new Throwable())));
} else {
LOG.debug(sb.toString());
}
}
use of org.kuali.kfs.kim.impl.identity.principal.Principal in project cu-kfs by CU-CommunityApps.
the class RoleServiceImpl method logPrincipalHasRoleCheck.
protected void logPrincipalHasRoleCheck(String principalId, List<String> roleIds, Map<String, String> roleQualifiers) {
StringBuilder sb = new StringBuilder();
sb.append('\n');
sb.append("Has Role : ").append(roleIds).append('\n');
if (roleIds != null) {
for (String roleId : roleIds) {
RoleLite role = getRoleWithoutMembers(roleId);
if (role != null) {
sb.append(" Name : ").append(role.getNamespaceCode()).append('/').append(role.getName());
sb.append(" (").append(roleId).append(')');
sb.append('\n');
}
}
}
sb.append(" Principal : ").append(principalId);
if (principalId != null) {
Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(principalId);
if (principal != null) {
sb.append(" (").append(principal.getPrincipalName()).append(')');
}
}
sb.append('\n');
sb.append(" Details :\n");
if (roleQualifiers != null) {
sb.append(roleQualifiers);
} else {
sb.append(" [null]\n");
}
if (LOG.isTraceEnabled()) {
LOG.trace(sb.append(ExceptionUtils.getStackTrace(new Throwable())));
} else {
LOG.debug(sb.toString());
}
}
use of org.kuali.kfs.kim.impl.identity.principal.Principal in project cu-kfs by CU-CommunityApps.
the class ContractsGrantsInvoiceDocumentServiceImpl method getContractsGrantsInvoiceBatchCreationUserPrincipal.
/**
* Determines the user who creates CINV documents via the batch job
*
* @return the principal for the user who creates CINV documents via the batch job
*/
protected Principal getContractsGrantsInvoiceBatchCreationUserPrincipal() {
final String batchJobInitiatorPrincipalName = getParameterService().getParameterValueAsString(ContractsGrantsInvoiceDocumentBatchStep.class, Job.STEP_USER_PARM_NM, KFSConstants.SYSTEM_USER);
final Principal batchJobInitiatorPrincipal = getIdentityService().getPrincipalByPrincipalName(batchJobInitiatorPrincipalName);
return ObjectUtils.isNull(batchJobInitiatorPrincipal) ? getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER) : batchJobInitiatorPrincipal;
}
use of org.kuali.kfs.kim.impl.identity.principal.Principal in project cu-kfs by CU-CommunityApps.
the class PaymentSourceExtractionServiceImpl method extractImmediatePayments.
/**
* Pulls all disbursement vouchers with status of "A" and marked for immediate payment from the database and
* builds payment records for them
*/
@Override
public void extractImmediatePayments() {
if (LOG.isDebugEnabled()) {
LOG.debug("extractImmediatePayments() started");
}
final Date processRunDate = dateTimeService.getCurrentDate();
final Principal uuser = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER);
if (uuser == null) {
LOG.debug("extractPayments() Unable to find user " + KFSConstants.SYSTEM_USER);
throw new IllegalArgumentException("Unable to find user " + KFSConstants.SYSTEM_USER);
}
// Get a list of campuses that have documents with an 'A' (approved) status.
Map<String, List<PaymentSource>> documentsByCampus = paymentSourceToExtractService.retrievePaymentSourcesByCampus(true);
// Process each campus one at a time
for (String campusCode : documentsByCampus.keySet()) {
extractImmediatePaymentsForCampus(campusCode, uuser.getPrincipalId(), processRunDate, documentsByCampus.get(campusCode));
}
}
Aggregations