boolean isRoleNameChanged = false;
if (!desc.equals(updateExtRole.getName())) {
isRoleNameChanged = true;
+ addRole(updateExtRole, app.getUebKey()); //interchange 314 -315
deleteRoleInExtSystem(mapper, name);
- addRole(updateExtRole, app.getUebKey());
// add partner functions to the global role in External
// Auth System
if (!list.isEmpty() && isGlobalRole) {
roleFunc.getCode(), roleFunc.getAction());
extAddRolePerms = new ExternalAccessRolePerms(extAddPerms,
app.getNameSpace() + "." + updateExtRole.getName().replaceAll(
- EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+ EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
response = addRoleFuncExtSysRestAPI(mapper, extAddRolePerms, headers);
}
}
.setModified(epApp.getModified()).setCreatedId(epApp.getCreatedId())
.setModifiedId(epApp.getModifiedId()).setRowNum(epApp.getRowNum())
.setName(epApp.getName()).setImageUrl(epApp.getImageUrl())
- .setDescription(epApp.getDescription()).setNotes(epApp.getNotes())
- .setUrl(epApp.getUrl()).setAlternateUrl(epApp.getAlternateUrl())
+ .setDescription(epApp.getAppDescription()).setNotes(epApp.getAppNotes())
+ .setUrl(epApp.getLandingPage()).setAlternateUrl(epApp.getLandingPage())
.setRestEndpoint(epApp.getAppRestEndpoint()).setMlAppName(epApp.getMlAppName())
.setMlAppAdminId(epApp.getMlAppAdminId()).setMotsId(String.valueOf(epApp.getMotsId()))
- .setAppPassword(epApp.getAppPassword()).setOpen(String.valueOf(epApp.getOpen()))
+ .setAppPassword(epApp.getAppBasicAuthPassword()).setOpen(String.valueOf(epApp.getOpen()))
.setEnabled(String.valueOf(epApp.getEnabled())).setThumbnail(epApp.getThumbnail())
- .setUsername(epApp.getUsername()).setUebKey(epApp.getUebKey())
+ .setUsername(epApp.getAppBasicAuthUsername()).setUebKey(epApp.getUebKey())
.setUebSecret(epApp.getUebSecret()).setUebTopicName(epApp.getUebTopicName())
.createCentralApp();
cenApp.setAppPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD);
.containsKey(extAuthrole.substring(app.getNameSpace().length() + 1))) {
EPRole localAddFuntionRole = currentRolesInDB
.get(extAuthrole.substring(app.getNameSpace().length() + 1));
+
+ String key = extAuthrole.substring(app.getNameSpace().length() + 1);
+ Boolean isaddAppRoleFuncRequired = true;
+ if(localAddFuntionRole == null && key.contains("-")) {
+ key = key.replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_");
+ localAddFuntionRole = currentRolesInDB.get(key);
+ if(localAddFuntionRole !=null) {
+ isaddAppRoleFuncRequired = false;
+ }
+ }
+
+ logger.info("key >>>>>"+key);
+ logger.info("localAddFuntionRole >>>>>"+localAddFuntionRole);
if (localAddFuntionRole == null) {
checkAndAddRoleInDB(app, currentRolesInDB, roleFunctionList, extAuthrole);
} else {
- EPAppRoleFunction addAppRoleFunc = new EPAppRoleFunction();
- addAppRoleFunc.setAppId(app.getId());
- addAppRoleFunc.setCode(roleFunctionList.get(0).getCode());
- addAppRoleFunc.setRoleId(localAddFuntionRole.getId());
- dataAccessService.saveDomainObject(addAppRoleFunc, null);
+ if(isaddAppRoleFuncRequired) {
+ EPAppRoleFunction addAppRoleFunc = new EPAppRoleFunction();
+ addAppRoleFunc.setAppId(app.getId());
+ addAppRoleFunc.setCode(roleFunctionList.get(0).getCode());
+ addAppRoleFunc.setRoleId(localAddFuntionRole.getId());
+ dataAccessService.saveDomainObject(addAppRoleFunc, null);
+ }
}
}
// This block is to save global role function if exists
applicationRolesList = getAppRoles(app.getId());
List<String> applicationRoleIdList = new ArrayList<>();
for (EPRole applicationRole : applicationRolesList) {
- applicationRoleIdList.add(applicationRole.getName());
+ applicationRoleIdList.add(applicationRole.getName().trim());
}
List<EPRole> roleListToBeAddInEcompDB = new ArrayList<>();
for (EPRole aafRole : finalRoleList) {
- if (!applicationRoleIdList.contains(aafRole.getName())) {
+ if (!applicationRoleIdList.contains(aafRole.getName().trim())) {
roleListToBeAddInEcompDB.add(aafRole);
}
}
String name = extRole.getJSONObject(i).getString(ROLE_NAME);
String actualRoleName = name.substring(app.getNameSpace().length() + 1);
if (extRole.getJSONObject(i).has(EXTERNAL_AUTH_ROLE_DESCRIPTION)) {
- actualRoleName = extRole.getJSONObject(i).getString(EXTERNAL_AUTH_ROLE_DESCRIPTION);
+ String description = extRole.getJSONObject(i).getString(EXTERNAL_AUTH_ROLE_DESCRIPTION);
+
+ if(actualRoleName.replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS_EXCLUDE_HYPHEN,"_")
+ .equalsIgnoreCase(description.replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS_EXCLUDE_HYPHEN,"_"))){
+ actualRoleName = description;
+ }
}
SortedSet<ExternalAccessPerms> externalAccessPermsOfRole = new TreeSet<>();
if (extRole.getJSONObject(i).has(EXTERNAL_AUTH_PERMS)) {
params.put("uebKey", app.getUebKey());
List<BulkUploadUserRoles> userRolesList = null;
Integer userRolesAdded = 0;
- if (app.getCentralAuth()) {
+ if (app.getRolesInAAF()) {
userRolesList = dataAccessService.executeNamedQuery("getBulkUserRoles", params, null);
for (BulkUploadUserRoles userRolesUpload : userRolesList) {
if (!userRolesUpload.getOrgUserId().equals("su1234")) {
params.put("roleId", String.valueOf(roleId));
List<BulkUploadUserRoles> userRolesList = null;
Integer userRolesAdded = 0;
- if (app.getCentralAuth()) {
+ if (app.getRolesInAAF()) {
userRolesList = dataAccessService.executeNamedQuery("getBulkUsersForSingleRole", params, null);
for (BulkUploadUserRoles userRolesUpload : userRolesList) {
userRolesUpload.setRoleName(modifiedRoleName);