protected List<ClockLogBo> filterLookupResults(List<ClockLogBo> rawResults, String userPrincipalId) { List<ClockLogBo> results = new ArrayList<ClockLogBo>(); for (ClockLogBo clockLogObj : rawResults) { String department = clockLogObj.getDept(); String groupKeyCode = clockLogObj.getGroupKeyCode(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, clockLogObj.getClockDateTime().toLocalDate()); String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : 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(clockLogObj); } } return results; }
public HrGroupKey build() { return new HrGroupKey(this); }
@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(), "%"); } } } }
private List<ShiftCalendarInterval> getShiftCalendarIntervals(TimesheetDocument timesheetDocument, DateTimeZone zone) { PrincipalHRAttributes principalCal = HrServiceLocator.getPrincipalHRAttributeService().getPrincipalCalendar(timesheetDocument.getPrincipalId(),timesheetDocument.getCalendarEntry().getEndPeriodFullDateTime().toLocalDate()); Map<String, Set<Long>> jobsForShiftRule = new HashMap<>(); Map<String, ShiftDifferentialRule> shiftDifferentialRuleMap = new HashMap<>(); for (Job job : timesheetDocument.getJobs()) { List<ShiftDifferentialRule> shiftDifferentialRules = getShiftDifferentalRules(job.getGroupKey().getLocationId(),job.getHrSalGroup(),job.getPayGrade(),principalCal.getPayCalendar(), timesheetDocument.getCalendarEntry().getEndPeriodFullDateTime().toLocalDate()); for (ShiftDifferentialRule sdr : shiftDifferentialRules) { shiftDifferentialRuleMap.put(sdr.getId(), sdr); if (jobsForShiftRule.containsKey(sdr.getId())) { jobsForShiftRule.get(sdr.getId()).add(job.getJobNumber()); } else { Set<Long> tempSet = new HashSet<>(); tempSet.add(job.getJobNumber()); jobsForShiftRule.put(sdr.getId(), tempSet); } } } List<ShiftCalendarInterval> sci = new ArrayList<>(); CalendarEntry ce = timesheetDocument.getCalendarEntry(); for (Map.Entry<String, Set<Long>> entry : jobsForShiftRule.entrySet()) { sci.add(new ShiftCalendarInterval(entry.getValue(), shiftDifferentialRuleMap.get(entry.getKey()), ce.getBeginPeriodLocalDateTime(), ce.getEndPeriodLocalDateTime(), zone)); } return sci; }
public List<DailyOvertimeRule> getDailyOvertimeRules(String userPrincipalId, List <DailyOvertimeRule> dailyOvertimeRuleObjs){ List<DailyOvertimeRule> results = new ArrayList<DailyOvertimeRule>(); if ( dailyOvertimeRuleObjs != null ){ for (DailyOvertimeRule dailyOvertimeRuleObj : dailyOvertimeRuleObjs) { String department = dailyOvertimeRuleObj.getDept(); String groupKeyCd = dailyOvertimeRuleObj.getGroupKeyCode(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCd, dailyOvertimeRuleObj.getEffectiveLocalDate()); String loc = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : 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(), groupKeyCd); roleQualification.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), loc); 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(dailyOvertimeRuleObj); } } } return results; } }
@Override public List<DeptLunchRule> getDepartmentLunchRules(String userPrincipalId, List<DeptLunchRule> departmentLunchRuleObjs) { List<DeptLunchRule> results = new ArrayList<DeptLunchRule>(); if (departmentLunchRuleObjs != null ){ for (DeptLunchRule departmentLunchRuleObj : departmentLunchRuleObjs) { String department = departmentLunchRuleObj.getDept(); String grpKeyCode = departmentLunchRuleObj.getGroupKeyCode(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, grpKeyCode, departmentLunchRuleObj.getEffectiveLocalDate()); String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : 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(), grpKeyCode); 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(departmentLunchRuleObj); } } } return results; } }
private Map<Long,Set<ShiftDifferentialRule>> getJobNumberToShiftRuleMap(TimesheetDocument timesheetDocument) { Map<Long,Set<ShiftDifferentialRule>> jobNumberToShifts = new HashMap<>(); PrincipalHRAttributes principalCal = HrServiceLocator.getPrincipalHRAttributeService().getPrincipalCalendar(timesheetDocument.getPrincipalId(),timesheetDocument.getCalendarEntry().getEndPeriodFullDateTime().toLocalDate()); for (Job job : timesheetDocument.getJobs()) { List<ShiftDifferentialRule> shiftDifferentialRules = getShiftDifferentalRules(job.getGroupKey().getLocationId(),job.getHrSalGroup(),job.getPayGrade(),principalCal.getPayCalendar(), timesheetDocument.getCalendarEntry().getEndPeriodFullDateTime().toLocalDate()); if (shiftDifferentialRules.size() > 0) jobNumberToShifts.put(job.getJobNumber(), new HashSet<>(shiftDifferentialRules)); } return jobNumberToShifts; }
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; } }
protected void addRoleQualification(Object dataObject, Map<String, String> attributes) { super.addRoleQualification(dataObject, attributes); String department = StringUtils.EMPTY; String location = StringUtils.EMPTY; String groupKeyCode = StringUtils.EMPTY; if (dataObject instanceof TimeCollectionRule) { TimeCollectionRule timeCollectionRuleObj = (TimeCollectionRule) dataObject; if (timeCollectionRuleObj != null) { department = timeCollectionRuleObj.getDept(); groupKeyCode = timeCollectionRuleObj.getGroupKeyCode(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, timeCollectionRuleObj.getEffectiveLocalDate()); if (departmentObj != null) { location = departmentObj.getGroupKey().getLocationId(); } } } attributes.put(KPMERoleMemberAttribute.DEPARTMENT.getRoleMemberAttributeName(), department); attributes.put(KPMERoleMemberAttribute.GROUP_KEY_CODE.getRoleMemberAttributeName(), groupKeyCode); attributes.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), location); }
protected void addRoleQualification(Object dataObject, Map<String, String> attributes) { super.addRoleQualification(dataObject, attributes); String department = StringUtils.EMPTY; String location = StringUtils.EMPTY; String groupKeyCode = StringUtils.EMPTY; if (dataObject instanceof ClockLocationRule) { ClockLocationRule clockLocationRuleObj = (ClockLocationRule) dataObject; if (clockLocationRuleObj != null) { department = clockLocationRuleObj.getDept(); groupKeyCode = clockLocationRuleObj.getGroupKeyCode(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, clockLocationRuleObj.getEffectiveLocalDate()); if (departmentObj != null) { location = departmentObj.getGroupKey().getLocationId(); } } } attributes.put(KPMERoleMemberAttribute.DEPARTMENT.getRoleMemberAttributeName(), department); attributes.put(KPMERoleMemberAttribute.GROUP_KEY_CODE.getRoleMemberAttributeName(), department); attributes.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), location); }
protected void addRoleQualification(Object dataObject, Map<String, String> attributes) { super.addRoleQualification(dataObject, attributes); String department = StringUtils.EMPTY; String location = StringUtils.EMPTY; String groupKeyCode = StringUtils.EMPTY; if (dataObject instanceof DeptLunchRule) { DeptLunchRule departmentLunchRuleObj = (DeptLunchRule) dataObject; if (departmentLunchRuleObj != null) { department = departmentLunchRuleObj.getDept(); groupKeyCode = departmentLunchRuleObj.getGroupKeyCode(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, departmentLunchRuleObj.getEffectiveLocalDate()); if (departmentObj != null) { location = departmentObj.getGroupKey().getLocationId(); } } } attributes.put(KPMERoleMemberAttribute.DEPARTMENT.getRoleMemberAttributeName(), department); attributes.put(KPMERoleMemberAttribute.GROUP_KEY_CODE.getRoleMemberAttributeName(), groupKeyCode); attributes.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), location); }
public List<TimeCollectionRule> getTimeCollectionRules(String userPrincipalId, List <TimeCollectionRule> timeCollectionRuleObjs){ List<TimeCollectionRule> results = new ArrayList<TimeCollectionRule>(); if ( timeCollectionRuleObjs != null ){ for (TimeCollectionRule timeCollectionRuleObj : timeCollectionRuleObjs) { String department = timeCollectionRuleObj.getDept(); String grpKeyCode = timeCollectionRuleObj.getGroupKeyCode(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, grpKeyCode, timeCollectionRuleObj.getEffectiveLocalDate()); String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : null; Map<String, String> permissionDetails = new HashMap<String, String>(); permissionDetails.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME, KRADServiceLocatorWeb.getDocumentDictionaryService().getMaintenanceDocumentTypeName(TimeCollectionRule.class)); 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(), grpKeyCode); roleQualification.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), location); if (!KimApiServiceLocator.getPermissionService().isPermissionDefinedByTemplate(KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), permissionDetails) || KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(userPrincipalId, KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), permissionDetails, roleQualification)) { results.add(timeCollectionRuleObj); } } } return results; } }
private List<MissedPunchBo> filterByPrincipalId(List<MissedPunchBo> missedPunches, String principalId) { List<MissedPunchBo> results = new ArrayList<MissedPunchBo>(); //TODO - performance too many db calls in loop for (MissedPunchBo missedPunch : missedPunches) { JobContract jobObj = HrServiceLocator.getJobService().getJob(missedPunch.getPrincipalId(), missedPunch.getJobNumber(), LocalDate.fromDateFields(missedPunch.getActionDate())); String department = jobObj != null ? jobObj.getDept() : null; String groupKeyCode = jobObj != null ? jobObj.getGroupKeyCode() : null; Department departmentObj = jobObj != null ? HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, LocalDate.fromDateFields(missedPunch.getActionDate())) : null; String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : null; Map<String, String> roleQualification = new HashMap<String, String>(); roleQualification.put(KimConstants.AttributeConstants.PRINCIPAL_ID, GlobalVariables.getUserSession().getPrincipalId()); 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(principalId, KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), new HashMap<String, String>(), roleQualification)) { results.add(missedPunch); } } return results; }
private List<TimeBlockBo> filterByPrincipalId(List<TimeBlockBo> timeBlocks, String principalId) { List<TimeBlockBo> results = new ArrayList<TimeBlockBo>(); //TODO - performance too many db calls in loop for (TimeBlockBo timeBlock : timeBlocks) { JobContract jobObj = HrServiceLocator.getJobService().getJob(timeBlock.getPrincipalId(), timeBlock.getJobNumber(), LocalDate.fromDateFields(timeBlock.getBeginDate()), false); String department = jobObj != null ? jobObj.getDept() : null; String groupKeyCode = jobObj != null ? jobObj.getGroupKeyCode() : null; Department departmentObj = jobObj != null ? HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, LocalDate.fromDateFields(timeBlock.getBeginDate())) : null; String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : null; Map<String, String> roleQualification = new HashMap<String, String>(); roleQualification.put(KimConstants.AttributeConstants.PRINCIPAL_ID, GlobalVariables.getUserSession().getPrincipalId()); 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(principalId, KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), new HashMap<String, String>(), roleQualification)) { results.add(timeBlock); } } return results; }
private List<TimeBlockHistory> filterByPrincipalId(List<TimeBlockHistory> timeBlockHistories, String principalId) { List<TimeBlockHistory> results = new ArrayList<TimeBlockHistory>(); //TODO - performance too many db calls in loop for (TimeBlockHistory timeBlockHistory : timeBlockHistories) { JobContract jobObj = HrServiceLocator.getJobService().getJob(timeBlockHistory.getPrincipalId(), timeBlockHistory.getJobNumber(), LocalDate.fromDateFields(timeBlockHistory.getBeginDate()), false); String department = jobObj != null ? jobObj.getDept() : null; String groupKeyCode = jobObj != null ? jobObj.getGroupKeyCode() : null; Department departmentObj = jobObj != null ? HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, LocalDate.fromDateFields(timeBlockHistory.getBeginDate())) : null; String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : null; Map<String, String> roleQualification = new HashMap<String, String>(); roleQualification.put(KimConstants.AttributeConstants.PRINCIPAL_ID, GlobalVariables.getUserSession().getPrincipalId()); 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(principalId, KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), new HashMap<String, String>(), roleQualification)) { results.add(timeBlockHistory); } } return results; }
@Override public boolean isAuthorizedForDocument(String principalId, Document document) { try { MissedPunchDocument mpd = (MissedPunchDocument) KRADServiceLocatorWeb.getDocumentService().getByDocumentHeaderId(document.getDocumentId()); String groupKey = mpd.getGroupKeyCode(); Long workArea = mpd.getWorkArea(); String department = mpd.getDepartment(); String location = mpd.getGroupKey() != null ? mpd.getGroupKey().getLocationId() : HrServiceLocator.getHrGroupKeyService().getHrGroupKey(mpd.getGroupKeyCode(), mpd.getMissedPunch().getActionLocalDate()).getLocationId(); Map<String, String> roleQualification = new HashMap<String, String>(); roleQualification.put(KimConstants.AttributeConstants.PRINCIPAL_ID, principalId); roleQualification.put(KPMERoleMemberAttribute.DEPARTMENT.getRoleMemberAttributeName(), department); roleQualification.put(KPMERoleMemberAttribute.WORK_AREA.getRoleMemberAttributeName(), workArea.toString()); roleQualification.put(KPMERoleMemberAttribute.GROUP_KEY_CODE.getRoleMemberAttributeName(), groupKey); roleQualification.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), location); Map<String, String> permissionDetails = new HashMap<String, String>(); permissionDetails.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME, KRADServiceLocatorWeb.getDocumentDictionaryService().getDocumentTypeByClass(MissedPunchDocument.class)); return (!KimApiServiceLocator.getPermissionService().isPermissionDefinedByTemplate(KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), new HashMap<String, String>()) || KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(principalId, KPMENamespace.KPME_WKFLW.getNamespaceCode(), KPMEPermissionTemplate.VIEW_KPME_RECORD.getPermissionTemplateName(), permissionDetails, roleQualification)); } catch (WorkflowException e) { return false; } } }
Long workArea = mpd.getWorkArea(); String department = mpd.getDepartment(); String location = mpd.getGroupKey() != null ? mpd.getGroupKey().getLocationId() : HrServiceLocator.getHrGroupKeyService().getHrGroupKey(mpd.getGroupKeyCode(), mpd.getMissedPunch().getActionLocalDate()).getLocationId();
String groupKeyCode = job != null ? job.getGroupKeyCode() : null; Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, LocalDate.fromDateFields(lb.getLeaveDate())); String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : null;
targetUserLocation = targetUserJob.get(0).getGroupKey().getLocationId();
String groupKeyCode = job.getGroupKeyCode(); Department departmentObj = HrServiceLocator.getDepartmentService().getDepartment(department, groupKeyCode, effectiveLocalDate); String location = departmentObj != null ? departmentObj.getGroupKey().getLocationId() : null;