Skip to content

Commit 0cdb0e7

Browse files
petar-i-todorovyordan-mitevdnikolov-prg
authored
docs: add kb on how to restrict new sql connections in wrd (#1846)
* docs: add kb on how to restrict new sql connections in wrd * fix title casing * Update knowledge-base/disable-build-new-data-connections-wrd.md Co-authored-by: Yordan <[email protected]> * Update knowledge-base/disable-build-new-data-connections-wrd.md * Update knowledge-base/disable-build-new-data-connections-wrd.md * Update disable-build-new-data-connections-wrd.md --------- Co-authored-by: Yordan <[email protected]> Co-authored-by: Dimitar Nikolov <[email protected]>
1 parent 7122d1f commit 0cdb0e7

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: How to Disable "Build new data connections" in the SqlDataSource Wizard of the Web Report Designer
3+
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.
4+
type: how-to
5+
page_title: How to Disable "Build New Data Connections" in Web Report Designer
6+
meta_title: How to Disable "Build New Data Connections" in Web Report Designer
7+
slug: restricting-build-new-data-connections-report-designer
8+
tags: reporting, reportdesigner, datasource, connections, middleware
9+
res_type: kb
10+
---
11+
12+
## Environment
13+
14+
<table>
15+
<tbody>
16+
<tr>
17+
<td> Product </td>
18+
<td> Reporting </td>
19+
</tr>
20+
<tr>
21+
<td> Version </td>
22+
<td> 19.2.25.1001 </td>
23+
</tr>
24+
</tbody>
25+
</table>
26+
27+
## Description
28+
29+
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.
30+
31+
## Solution
32+
33+
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.
34+
35+
````C#
36+
app.Use(async (context, next) =>
37+
{
38+
if (context.Request.Path.Equals("/api/reportdesigner/connectionspermissions"))
39+
{
40+
context.Response.ContentType = "application/json";
41+
await context.Response.WriteAsync("{}"); // Return empty JSON to disable "Build new connections".
42+
return;
43+
}
44+
45+
await next();
46+
});
47+
````
48+
49+
## See Also
50+
51+
* [Web Report Designer Overview]({%slug web-report-designer/overview%})
52+
* [SqlDataSource Wizard Overview]({%slug telerikreporting/designing-reports/report-designer-tools/web-report-designer/tools/sqldatasource-wizard%})

0 commit comments

Comments
 (0)