One last question…
I have now gotten this working in a non-static context. So, we have a table with these fields…
etf_serverName, etf_tableName, etf_dataProvider, etf_operator, etf_value, etf_empShortName
And a module with a method (code below) to run on startup for our solutions to filter the tables based on the user name they log in with. Will this slow things down as solutions grow, or is it a good idea to easily manage security accross tables this way?
/******************************************
SB 7/24/06
Filters tables based on user security setup
Parameters:
NA
Returns:
NA
******************************************/
var shortName = security.getUserName(); // gets the current loggedIn username
var maxReturnedRows = 100;
var query = 'SELECT etf_serverName, etf_tableName, etf_dataProvider, etf_operator, etf_value, etf_empShortName FROM EmpTableFilters ' +
'WHERE etf_empShortName = ?';
var args = new Array();
args[0] = shortName
var dataset = databaseManager.getDataSetByQuery("ddcinfo", query, args, maxReturnedRows);
for(var i=1; i<=dataset.getMaxRowIndex(); i++)
{
var myOperator = dataset.getValue(i, 4);
var myValue = dataset.getValue(i, 5);
if(myOperator == 'IN')
{
//create array of comma separated values
var myValArray = myValue.split(',')
var success = databaseManager.addTableFilterParam(dataset.getValue(i, 1), dataset.getValue(i, 2), dataset.getValue(i, 3), myOperator, myValArray)
}
else
{
var success = databaseManager.addTableFilterParam(dataset.getValue(i, 1), dataset.getValue(i, 2), dataset.getValue(i, 3), myOperator, myValue)
}
}
At this point it is working well, but the average user only has 2 tables that are being filtered. As we add more solutions, I would expect the average user to have about 50 tables being filtered. So…if 50 tables are filtered on the startup of a solution, is there much performance degradation?