Page 1 of 1

How to disable adding/editing dataSource

Posted: Wed Jun 08, 2022 6:10 am
by Vitalii_bizone
Hello! I need to disable user ability to add or change existing dataSource. And ability to add new relation :)
How can i do that?

Re: How to disable adding/editing dataSource

Posted: Wed Jun 08, 2022 7:00 pm
by Lech Kulikowski
Hello,

You can add Permissions for the Dictionary:
https://www.stimulsoft.com/en/documenta ... ttings.htm

Thank you.

Re: How to disable adding/editing dataSource

Posted: Thu Jun 09, 2022 1:42 pm
by Vitalii_bizone
Thanks for reply!
I've added lines:
options.dictionary.dataSourcesPermissions = Stimulsoft.Designer.StiDesignerPermissions.View;
options.dictionary.dataRelationsPermissions = Stimulsoft.Designer.StiDesignerPermissions.View;
options.dictionary.showAdaptersInNewConnectionForm = false;
options.dictionary.dataConnectionsPermissions = Stimulsoft.Designer.StiDesignerPermissions.View;

and now user cannot add connections or dataSources...but! usr still can add new dictionary! :) where creating new dataSource is available again :)
is it possible to prevent this?

Re: How to disable adding/editing dataSource

Posted: Mon Jun 13, 2022 9:25 am
by Lech Kulikowski
Hello,

Please check the following code:

Code: Select all

var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false);
            designer.renderHtml("content");

            var dictionaryPanel = designer.jsObject.options.dictionaryPanel;
            dictionaryPanel.toolBar.controls["Actions"].style.display = "none";
            dictionaryPanel.toolBar.controls["NewItem"].style.display = "none";

            //if you want to hide context menu for dictionary panel
            dictionaryPanel.onmouseup = function (event) {
                return false;
            }
Thank you.

Re: How to disable adding/editing dataSource

Posted: Tue Jun 14, 2022 5:31 am
by Vitalii_bizone
yes, thank you! this works! 8-)

Re: How to disable adding/editing dataSource

Posted: Tue Jun 14, 2022 10:22 pm
by Lech Kulikowski
Hello,

You are welcome.