Fix issues with retrieving visible roles

visiblefix
prathabanKavin 1 year ago
parent a8badb22c4
commit f091d26f9c

@ -126,14 +126,14 @@ public class RoleManagementServiceImpl implements RoleManagementService {
List<String> visibleRoles; List<String> visibleRoles;
RoleList visibleRoleList = new RoleList(); RoleList visibleRoleList = new RoleList();
try { try {
String metaValue = "{\"isUserAbleToViewAllRoles\":false}"; boolean decision = false;
if(DeviceMgtAPIUtils.getMetadataManagementService().retrieveMetadata(metaKey) != null){ if(DeviceMgtAPIUtils.getMetadataManagementService().retrieveMetadata(metaKey) != null){
metadata = DeviceMgtAPIUtils.getMetadataManagementService().retrieveMetadata(metaKey); metadata = DeviceMgtAPIUtils.getMetadataManagementService().retrieveMetadata(metaKey);
metaValue = metadata.getMetaValue(); String metaValue = metadata.getMetaValue();
}
JSONParser parser = new JSONParser(); JSONParser parser = new JSONParser();
JSONObject jsonObject = (JSONObject) parser.parse(metaValue); JSONObject jsonObject = (JSONObject) parser.parse(metaValue);
boolean decision = (boolean) jsonObject.get(Constants.IS_USER_ABLE_TO_VIEW_ALL_ROLES); decision = (boolean) jsonObject.get(Constants.IS_USER_ABLE_TO_VIEW_ALL_ROLES);
}
if (decision) { if (decision) {
if (userStore == null || "".equals(userStore)){ if (userStore == null || "".equals(userStore)){
userStore = PRIMARY_USER_STORE; userStore = PRIMARY_USER_STORE;

Loading…
Cancel
Save