diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 7e444c706b..0337a0a079 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -82,8 +82,13 @@ public class OperationManagerImpl implements OperationManager { } } try { - List authorizedDeviceList = DeviceManagementDataHolder.getInstance(). - getDeviceAccessAuthorizationService().isUserAuthorized(deviceIds).getAuthorizedDevices(); + List authorizedDeviceList; + if (operation != null && PolicyOperation.POLICY_OPERATION_CODE.equals(operation.getCode())) { + authorizedDeviceList = deviceIds; + } else { + authorizedDeviceList = DeviceManagementDataHolder.getInstance(). + getDeviceAccessAuthorizationService().isUserAuthorized(deviceIds).getAuthorizedDevices(); + } if (authorizedDeviceList.size() > 0) { try { int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();