|
|
|
@ -28,6 +28,7 @@ import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorization
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager;
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.DeviceManagementConstants;
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
|
|
|
@ -83,7 +84,7 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
List<DeviceIdentifier> authorizedDeviceList;
|
|
|
|
|
if (operation != null && PolicyOperation.POLICY_OPERATION_CODE.equals(operation.getCode())) {
|
|
|
|
|
if (operation != null && isAuthenticationSkippedOperation(operation)) {
|
|
|
|
|
authorizedDeviceList = deviceIds;
|
|
|
|
|
} else {
|
|
|
|
|
authorizedDeviceList = DeviceManagementDataHolder.getInstance().
|
|
|
|
@ -618,4 +619,20 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
return CarbonContext.getThreadLocalCarbonContext().getUsername();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean isAuthenticationSkippedOperation(Operation operation) {
|
|
|
|
|
boolean status;
|
|
|
|
|
switch (operation.getCode()) {
|
|
|
|
|
case DeviceManagementConstants.AuthorizationSkippedOperationCodes.POLICY_OPERATION_CODE :
|
|
|
|
|
status = true;
|
|
|
|
|
break;
|
|
|
|
|
case DeviceManagementConstants.AuthorizationSkippedOperationCodes.MONITOR_OPERATION_CODE :
|
|
|
|
|
status = true;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
status = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|