In my solution, an user belonging to the Administrators group can add more groups and add users to groups (I do that using methods).
I need to activate the tracking on some tables for the new created groups. Is there a way to do that, other than using Servoy Developer (Tools->Security->Tables)?
Yes, you can do this using security.setSecuritySettings at startup of the client. See below the updated sample code, detailing this feature:
//sets the security settings; the entries contained in the given dataset will override those contained in the current security settings var colNames = new Array(); colNames[0] = 'id'; 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] = 1|2; // 1 viewable , 2 accessible; use bitwise 'or' (1|2) for both dataset.addRow(row);//setting element security
row = new Array();
row[0] = 'example_data.orders';
row[1] = 1|2|4|8|16; // 1 = READ / 2 = INSERT / 4 = UPDATE / 8 = DELETE / 16 = TRACKING; use bitwise 'or' like (1|2|4) for multiple flags dataset.addRow(row);//setting table security
security.setSecuritySettings(dataset);//to be called in solution startup method
//sets the security settings; the entries contained in the given dataset will override those contained in the current security settings
var colNames = new Array();
colNames[0] = ‘id’;
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] = 1|2; // 1 viewable , 2 accessible; use bitwise ‘or’ (1|2) for both
dataset.addRow(row);//setting element security