public String getBusinessKeyString() { return getGroupKeyCode() + "|" + getDept(); }
public List<ClockLocationRule> getClockLocationRules(String userPrincipalId, List <ClockLocationRule> clockLocationRuleObjs) { List<ClockLocationRule> results = new ArrayList<ClockLocationRule>(); if ( clockLocationRuleObjs != null ){ for (ClockLocationRule clockLocationRuleObj : clockLocationRuleObjs) { String department = clockLocationRuleObj.getDept(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, clockLocationRuleObj.getGroupKeyCode(), clockLocationRuleObj.getEffectiveLocalDate()); String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : null; String groupKeyCode = departmentObj != null ? departmentObj.getGroupKeyCode() : null; Map<String, String> roleQualification = new HashMap<String, String>(); roleQualification.put(KimConstants.AttributeConstants.PRINCIPAL_ID, userPrincipalId); roleQualification.put(KPMERoleMemberAttribute.DEPARTMENT.getRoleMemberAttributeName(), department); roleQualification.put(KPMERoleMemberAttribute.GROUP_KEY_CODE.getRoleMemberAttributeName(), groupKeyCode); roleQualification.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), location); if (!KimApiServiceLocator.getPermissionService().isPermissionDefinedByTemplate(KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), new HashMap<String, String>()) || KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(userPrincipalId, KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), new HashMap<String, String>(), roleQualification)) { results.add(clockLocationRuleObj); } } } return results; } }
@Override protected void addRoleQualification(Object dataObject, Map<String, String> attributes) { super.addRoleQualification(dataObject, attributes); if ( (dataObject instanceof PositionBo) || (dataObject instanceof PositionContract) || (dataObject instanceof Position)) { PositionBo positionObj = (PositionBo) dataObject; if (positionObj != null) { Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(positionObj.getPrimaryDepartment(), positionObj.getGroupKeyCode(), positionObj.getEffectiveLocalDate()); if (departmentObj != null) { attributes.put(KPMERoleMemberAttribute.INSTITUION.getRoleMemberAttributeName(), departmentObj.getGroupKey().getInstitutionCode()); attributes.put(KPMERoleMemberAttribute.DEPARTMENT.getRoleMemberAttributeName(), departmentObj.getDept()); attributes.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), departmentObj.getGroupKey().getLocationId()); attributes.put(KPMERoleMemberAttribute.ORGANIZATION.getRoleMemberAttributeName(), departmentObj.getOrg()); attributes.put(KPMERoleMemberAttribute.GROUP_KEY_CODE.getRoleMemberAttributeName(), departmentObj.getGroupKeyCode()); } else { attributes.put(KPMERoleMemberAttribute.INSTITUION.getRoleMemberAttributeName(), "%"); attributes.put(KPMERoleMemberAttribute.DEPARTMENT.getRoleMemberAttributeName(), "%"); attributes.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), "%"); attributes.put(KPMERoleMemberAttribute.ORGANIZATION.getRoleMemberAttributeName(), "%"); attributes.put(KPMERoleMemberAttribute.GROUP_KEY_CODE.getRoleMemberAttributeName(), "%"); } } } }
return true; if(HrServiceLocator.getKPMERoleService().principalHasRoleInDepartment(principalId, KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.PAYROLL_PROCESSOR.getRoleName(), aDept.getDept(), aDept.getGroupKeyCode(), LocalDate.now().toDateTimeAtStartOfDay())) { return true; if(HrServiceLocator.getKPMERoleService().principalHasRoleInDepartment(principalId, KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.PAYROLL_PROCESSOR_DELEGATE.getRoleName(), aDept.getDept(), aDept.getGroupKeyCode(), LocalDate.now().toDateTimeAtStartOfDay())) { return true;