Enabling tracking (audit trail) using methods

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)?

No currently not.

Is this possible now (5 years later). As we also get in trouble for the same reasons using Servoy 3.5.7 on production servers ?

An alternative (nice) would be to change the default behaviour in order that audit trail would be automatically set to true.

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

This is available in 3.5.7 and 4.x

Paul

//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

see bit 16 which enables tracking.

This is available in 3.5.7 and …

Isn’t this Servoy 4 only? I cannot see security.setSecuritySettings in 3.5.7.

Mmm, I might be mistaken.

Paul