Merge pull request 'Fix for visible role issue' (#190) from prathabanKavin/device-mgt-core:visiblerolefix into master

Reviewed-on: community/device-mgt-core#190
sync
commit a8badb22c4

@ -126,8 +126,11 @@ 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}";
if(DeviceMgtAPIUtils.getMetadataManagementService().retrieveMetadata(metaKey) != null){
metadata = DeviceMgtAPIUtils.getMetadataManagementService().retrieveMetadata(metaKey); metadata = DeviceMgtAPIUtils.getMetadataManagementService().retrieveMetadata(metaKey);
String metaValue = metadata.getMetaValue(); 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); boolean decision = (boolean) jsonObject.get(Constants.IS_USER_ABLE_TO_VIEW_ALL_ROLES);

Loading…
Cancel
Save