Hi ,
I faced a strange issue with SysQuery Form when cross company is enabled.
Consider these scenario, I have a user who is a finance manager in a legal entity say LE01. But he has access to Employee role in le01,Le02,Le03 . I have more than 20 Legal entities. Now with his role mapping to legal entities he shouldnot have more than Le01 data access for finance reports. Strange thing is that sysQueryForm doesnt validate the access to LE wrt to access to report. It allows me to select the le01,le02,le03 . Which is the first issue. If we select the Le02 , Le03 we are able to see this data in the report
The worst part of the issue is when i select Le01,Le02,Le03 select all will be enabled in the company range tab in the sysquery form . Now i will get the data not just related these 3 legal entities but remaining 17 legal entities are also rendered.
Now i had to create a new controller extending srsReportRunController and modify the prePromptModifyContract to get list of valid agencies that user has access to this report menu using (SecurityRole,SecurityRoleUser,SecurityRoleExplodedGraph,SecurityRoleTaskGrant,SecurityTaskExplodedGraph,SecurableObject, OmUserOrganizationRole tables) , Validate in Pre-RunModifyContract agains this list for the list selected by the user
All this is done. I am able to filter the data based on the user access to entity.
The biggest challenge is in reports where the base tables are crossCompany this is causing the Ax32serv.exe process ie AOS to crash. I have checked using the trace parser and found that when ever and query.addcompanyRange('example1') is used it will add this example1 as range to DATAAREA table which is added by kernel . This range value is blowing out of proportions . I add a max of 20 values based on the role at any given instance. Now when these 20 are added to query, i am able to see in trace parser that more than 380 values are added to range. I validate the values in the 'IN' statement list values that is generated , they repeat for 20 times or so. There is no real reason for this strange behavior that i could convince my self to restructure my code.
If you have a suggestion on what other ways i can achieve cross company ensuring that security access to data is still intact .
Regards
Venkatesh