diff --git a/knowledge-base/disable-build-new-data-connections-wrd.md b/knowledge-base/disable-build-new-data-connections-wrd.md new file mode 100644 index 000000000..ebd42be27 --- /dev/null +++ b/knowledge-base/disable-build-new-data-connections-wrd.md @@ -0,0 +1,52 @@ +--- +title: How to Disable "Build new data connections" in the SqlDataSource Wizard of the Web Report Designer +description: Learn how to restrict the "Build new data connections" option in the "Choose data connection" window of the SqlDataSource wizard of the Web Report Designer while allowing users to select from existing data connections. +type: how-to +page_title: How to Disable "Build New Data Connections" in Web Report Designer +meta_title: How to Disable "Build New Data Connections" in Web Report Designer +slug: restricting-build-new-data-connections-report-designer +tags: reporting, reportdesigner, datasource, connections, middleware +res_type: kb +--- + +## Environment + + + + + + + + + + + + +
Product Reporting
Version 19.2.25.1001
+ +## Description + +I need to prevent users from creating new database connections in the Web Report Designer's SqlDataSource component while still allowing them to select from pre-configured existing connections. + +## Solution + +To stop users from creating new SQL database connections, use a middleware to intercept the `/api/reportdesigner/connectionspermissions` request and modify the response. By returning an empty JSON or an object with all values set to `false`, you can disable the "Build new data connections" option. + +````C# +app.Use(async (context, next) => +{ + if (context.Request.Path.Equals("/api/reportdesigner/connectionspermissions")) + { + context.Response.ContentType = "application/json"; + await context.Response.WriteAsync("{}"); // Return empty JSON to disable "Build new connections". + return; + } + + await next(); +}); +```` + +## See Also + +* [Web Report Designer Overview]({%slug web-report-designer/overview%}) +* [SqlDataSource Wizard Overview]({%slug telerikreporting/designing-reports/report-designer-tools/web-report-designer/tools/sqldatasource-wizard%})