|  | 
| 30 | 30 | import org.apache.streampipes.export.resolver.PipelineResolver; | 
| 31 | 31 | import org.apache.streampipes.manager.file.FileHandler; | 
| 32 | 32 | import org.apache.streampipes.model.SpDataStream; | 
| 33 |  | -import org.apache.streampipes.model.connect.adapter.AdapterDescription; | 
| 34 | 33 | import org.apache.streampipes.model.dashboard.DashboardModel; | 
| 35 | 34 | import org.apache.streampipes.model.datalake.DataExplorerWidgetModel; | 
| 36 | 35 | import org.apache.streampipes.model.datalake.DataLakeMeasure; | 
| @@ -81,31 +80,34 @@ protected void handleAsset(Map<String, byte[]> previewFiles, String assetId) thr | 
| 81 | 80 |   protected void handleAdapter(String document, String adapterId) throws JsonProcessingException { | 
| 82 | 81 |     if (shouldStore(adapterId, config.getAdapters())) { | 
| 83 | 82 |       writeDocument(document, new AdapterResolver()); | 
| 84 |  | -      permissionsToStore.add(new PermissionInfo(adapterId, AdapterDescription.class)); | 
|  | 83 | +      // adapters do not have permissions associated | 
| 85 | 84 |     } | 
| 86 | 85 |   } | 
| 87 | 86 | 
 | 
| 88 | 87 |   @Override | 
| 89 | 88 |   protected void handleChart(String document, String chartId) throws JsonProcessingException { | 
| 90 | 89 |     if (shouldStore(chartId, config.getDataViews())) { | 
| 91 | 90 |       writeDocument(document, new ChartResolver()); | 
| 92 |  | -      permissionsToStore.add(new PermissionInfo(chartId, DataExplorerWidgetModel.class)); | 
|  | 91 | +      var chart = new ChartResolver().deserializeDocument(document); | 
|  | 92 | +      permissionsToStore.add(new PermissionInfo(chart.getElementId(), DataExplorerWidgetModel.class)); | 
| 93 | 93 |     } | 
| 94 | 94 |   } | 
| 95 | 95 | 
 | 
| 96 | 96 |   @Override | 
| 97 | 97 |   protected void handleDashboard(String document, String dashboardId) throws JsonProcessingException { | 
| 98 | 98 |     if (shouldStore(dashboardId, config.getDashboards())) { | 
| 99 | 99 |       writeDocument(document, new DashboardResolver()); | 
| 100 |  | -      permissionsToStore.add(new PermissionInfo(dashboardId, DashboardModel.class)); | 
|  | 100 | +      var dashboard = new DashboardResolver().deserializeDocument(document); | 
|  | 101 | +      permissionsToStore.add(new PermissionInfo(dashboard.getElementId(), DashboardModel.class)); | 
| 101 | 102 |     } | 
| 102 | 103 |   } | 
| 103 | 104 | 
 | 
| 104 | 105 |   @Override | 
| 105 | 106 |   protected void handleDataSource(String document, String dataSourceId) throws JsonProcessingException { | 
| 106 | 107 |     if (shouldStore(dataSourceId, config.getDataSources())) { | 
| 107 | 108 |       writeDocument(document, new DataSourceResolver()); | 
| 108 |  | -      permissionsToStore.add(new PermissionInfo(dataSourceId, SpDataStream.class)); | 
|  | 109 | +      var dataStream = new DataSourceResolver().deserializeDocument(document); | 
|  | 110 | +      permissionsToStore.add(new PermissionInfo(dataStream.getElementId(), SpDataStream.class)); | 
| 109 | 111 |     } | 
| 110 | 112 |   } | 
| 111 | 113 | 
 | 
|  | 
0 commit comments