Prevent Edit of Connection string

Stimulsoft Reports.NET discussion
Post Reply
admin@secsol.co.uk
Posts: 63
Joined: Wed Jun 01, 2022 8:26 am

Prevent Edit of Connection string

Post by admin@secsol.co.uk »

In the report designer it is possible for the end user to edit the data connection string (ODBC) this is obviously a security risk as they can then see the login details etc.

In the web version I can prevent the end user from editing the connection string by doing this :

Code: Select all

 options.Dictionary.PermissionDataConnections = StiDesignerPermissions.View;
I have tried to do the same thing with my Windows program using this code that I found in another thread :

Code: Select all

  SelectedReport.SReport.Dictionary.Restrictions.Add("Cypher1", StiDataType.Database, StiRestrictionTypes.DenyEdit);
  StiOptions.Designer.CodeTabVisible = false;
However, this doesn't prevent the end user from editing the connection string.

How do I achieve the same thing as the web application in making the data connection read only?
Max Shamanov
Posts: 1062
Joined: Tue Sep 07, 2021 10:11 am

Re: Prevent Edit of Connection string

Post by Max Shamanov »

Hello,

Could you please send us a sample project that reproduces the issue?

Thank you.
admin@secsol.co.uk
Posts: 63
Joined: Wed Jun 01, 2022 8:26 am

Re: Prevent Edit of Connection string

Post by admin@secsol.co.uk »

It is okay, I have found the problem.

I was setting the Dictionary Restriction before I had added the Cypher1 data source - I have to set it afterwards.
Max Shamanov
Posts: 1062
Joined: Tue Sep 07, 2021 10:11 am

Re: Prevent Edit of Connection string

Post by Max Shamanov »

Hello.

Ok.
Let us know if you need our help.

Thank you.
Post Reply