Disable database connection editing in Designer
Posted: Thu Sep 19, 2024 7:38 pm
When I create a new report, by default I already add a standard connection to the database so that users can query and assemble the report.
But the database access details (connection string) are visible in the Designer and allow users to view the host name, username and password. I would like to prevent users from having access to these details in the Designer in some way.
Is it possible to disable the “Edit” button or hide the connection string?
I tried this approach but the "Edit" button still visible and enabled (I tried to set "DenyEdit" in every available option):
But when rendering the report the button still enabled: https://imgur.com/a/o5UK6Ee
This is how the report is being created:
But the database access details (connection string) are visible in the Designer and allow users to view the host name, username and password. I would like to prevent users from having access to these details in the Designer in some way.
Is it possible to disable the “Edit” button or hide the connection string?
I tried this approach but the "Edit" button still visible and enabled (I tried to set "DenyEdit" in every available option):
Code: Select all
final StiRestrictions restrictions = new StiRestrictions();
restrictions.Add("DB IS", StiDataType.DataSource, StiRestrictionTypes.DenyEdit);
restrictions.Add("DB IS", StiDataType.DataRelation, StiRestrictionTypes.DenyEdit);
restrictions.Add("DB IS", StiDataType.BusinessObject, StiRestrictionTypes.DenyEdit);
restrictions.Add("DB IS", StiDataType.DataColumn, StiRestrictionTypes.DenyEdit);
restrictions.Add("DB IS", StiDataType.Database, StiRestrictionTypes.DenyEdit);
restrictions.Add("DB IS", StiDataType.Variable, StiRestrictionTypes.DenyEdit);
restrictions.Add("DB IS", StiDataType.Total, StiRestrictionTypes.DenyEdit);
restrictions.Add("DB IS", StiDataType.Resource, StiRestrictionTypes.DenyEdit);
report.getDictionary().setRestrictions(restrictions);
This is how the report is being created:
Code: Select all
final StiReport report = new StiReport();
report.setReportName(input.getName());
StiPage page = new StiPage(report);
report.getPages().add(page);
page.setName(StiNameCreation.createName(report, StiNameCreation.generateName(page)));
final StiDatabaseCollection databases = new StiDatabaseCollection();
final StiPostgreSQLDatabase isDB = new StiPostgreSQLDatabase();
isDB.setName("DB IS");
isDB.setConnectionString(isConnectionString);
databases.add(isDB);
final StiDictionary dictionary = new StiDictionary(report);
dictionary.setDatabases(databases);
report.setDictionary(dictionary);