From b291c814c4b2436434a3cf30b028864070d63ead Mon Sep 17 00:00:00 2001 From: Shamalka Navod Date: Wed, 16 Oct 2019 13:27:20 +0000 Subject: [PATCH] Fix Device dis-enrollment issue in APPM --- .../device/mgt/jaxrs/service/api/DeviceManagementService.java | 3 ++- .../mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java | 1 + .../src/main/resources/conf/application-mgt.xml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index b2f032c762..3531154a6e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -919,10 +919,11 @@ public interface DeviceManagementService { //device remove request would looks like follows //DELETE devices/type/virtual_firealarm/id/us06ww93auzp @DELETE + @Consumes(MediaType.WILDCARD) @Path("/type/{device-type}/id/{device-id}") @ApiOperation( produces = MediaType.APPLICATION_JSON, - consumes = MediaType.APPLICATION_JSON, + consumes = MediaType.WILDCARD, httpMethod = "DELETE", value = "Remove the Device Specified by the Device ID", notes = "Returns the status of the deleted device operation and the details of the deleted device.", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index a5c2ca2024..ef89eb6ef8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -333,6 +333,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { } @DELETE + @Consumes(MediaType.WILDCARD) @Override @Path("/type/{device-type}/id/{device-id}") public Response deleteDevice(@PathParam("device-type") String deviceType, diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml index a4ccb6aa99..8baa364de2 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml @@ -256,6 +256,7 @@ perm:geo-service:analytics-view perm:geo-service:alerts-manage appm:rea + perm:devices:permanent-delete app-mgt