Hi all!
I have external app, that contain links to BIRT reports. When user clicks on the link that app adds kind of '&user_id=1234' string after *.rptdesign extension.
Based on that user_id I want to define user permissions.
So I have created:
a) ds_users

ds_permissions
c) ds_depots
datasets and corresponding parameters. Parameter user_id is set as hidden, required as well as user_permissions.
What I want to achieve is to restrict list of depots from within user could select one or many. Based on his/hers permissions user should be able to select:
a) only his/her depot

list of depots in his/her region (every depot is assign to region)
c) all depots
Question: what are possible paths to solve that problem?
I've tried to manipulate sql query od ds_depots dataset in beforeOpen() method with following code.
(I don't even know if it is possible):
if(reportContext.getParameterValue("p_perrmissions") == "66726")
{
this.queryText = this.queryText + " where id_company IN (" + reportContext.getParameterValue("p_firma_uzytkownika") + ")";
}
This is the place where I try to put if-elsle logic. Every if block represents another permission type and based on this should create different sql query that will be launch on ds_depots.
I think I colud also generate whole dataset from ds_depots and than filter it based on permissions.
The problem is to create link between user_id, his permissions and based on that informations, restrict ds_depots dataset.
Any suggestions highly welcome:)