- List<CentralV2RoleFunction> appRoleFunctionList = dataAccessService
- .executeNamedQuery("getAppRoleFunctionList", params, null);
- SortedSet<CentralV2RoleFunction> roleFunctionSet = new TreeSet<>();
- for (CentralV2RoleFunction roleFunc : appRoleFunctionList) {
- String functionCode = EcompPortalUtils.getFunctionCode(roleFunc.getCode());
- CentralV2RoleFunction cenRoleFunc = new CentralV2RoleFunction(roleFunc.getId(),
- functionCode, roleFunc.getName(), null, null);
- roleFunctionSet.add(cenRoleFunc);
- }
- Long userRoleId = null;
- if (globalRole.toLowerCase().startsWith("global_")
- && epApp.getId().equals(PortalConstants.PORTAL_APP_ID)) {
- userRoleId = userApp.getRole().getId();
- } else {
- userRoleId = userApp.getRole().getAppRoleId();
- }
- CentralV2Role cenRole = new CentralV2Role(userRoleId, userApp.getRole().getCreated(),
- userApp.getRole().getModified(), userApp.getRole().getCreatedId(),
- userApp.getRole().getModifiedId(), userApp.getRole().getRowNum(),
- userApp.getRole().getName(), userApp.getRole().getActive(),
- userApp.getRole().getPriority(), roleFunctionSet, null, null);
- cua.setRole(cenRole);