In my solution I have 3 groups and I want to set security settings for every group at table level, so I open the table, go to security tab and set the settings. I need to enter every table to set the settings, but the DB has >1000 tables!!
How can I do this without opening every table?
Thanks… Unfortunately, this section of the wiki has no examples
, so I don’ t know what’s the structure of dataset param of setSecuritySettings method…
juan.cristobo:
Thanks… Unfortunately, this section of the wiki has no examples , so I don’ t know what’s the structure of dataset param of setSecuritySettings method…
What about this? This almost explains itself:
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);
var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security
row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security
security.setSecuritySettings(dataset);//to be called in solution startup method
There’s barely structure you need to know.
1st column takes either the element UUID of a form or the [DB]. structure for your tables
2nd column tells its privileges.
You don’t have to assign any of this to a specific group as this a ‘per session’ setting you’ll apply on startup of the solution.
Then you already know which user it is, thus the security settings to apply.
I’d say go ahead, make an example deploy to your test server and enjoy the power…
Thanks, Marc
It’s strange… Yesterday I did’nt see any sample in the wiki page ![Shocked :shock:]()