100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Bug fix for read asset event (Fixes #543)
Rich Turnera5e9f634094f
diff --git a/manager/src/main/java/org/openremote/manager/asset/AssetStorageService.java b/manager/src/main/java/org/openremote/manager/asset/AssetStorageService.javaindex 91e362f58..f01fdcbcf 100644--- a/manager/src/main/java/org/openremote/manager/asset/AssetStorageService.java+++ b/manager/src/main/java/org/openremote/manager/asset/AssetStorageService.java@@ -384,13 +384,16 @@ public class AssetStorageService extends RouteBuilder implements ContainerServic}Access access = authContext.isSuperUser() || !identityService.getIdentityProvider().isRestrictedUser(authContext) ? PRIVATE : PROTECTED;+ AssetQuery assetQuery = new AssetQuery()+ .ids(assetId)+ .select(new Select().excludePath(false).excludeParentInfo(true))+ .access(access);- Asset<?> asset = find(- new AssetQuery()- .ids(assetId)- .select(new Select().excludePath(false).excludeParentInfo(true))- .userIds(access == PROTECTED ? authContext.getUserId() : null)- .access(access));+ if (access == PROTECTED) {+ assetQuery.userIds(authContext.getUserId());+ }++ Asset<?> asset = find(assetQuery);if (asset != null) {String messageId = exchange.getIn().getHeader(ClientEventService.HEADER_REQUEST_RESPONSE_MESSAGE_ID, String.class);