Hi developers. Any idea, why would ‘find’ method of the class work for one role, and not for the other? i cant see any permissions on the table, nor the code permissions for the method.
it looks like this:
projInvoiceTable = ProjInvoiceTable::find(projTableLocal.ProjInvoiceProjId);
projSalesCurrencyCodeLocal = projInvoiceTable.CurrencyId;
so for one user/role, it finds the projInvoiceTable, and gets the right CurrencyId, and for other it doesnt, and the ProjInvoiceProjId is there all the times.
where should i look for security which would prevent it, or how do i override the security?
Thanks,Pedja
I don’t think it’s about security and therefore you’re probably looking into a wrong direction.
Are you sure that the select statement in find() is the only piece of code that behaves differently?
Are both uses in the same data area?
Thats a good point, cross-company validation is in place and it works. So far, i can only see that statement as a point where the process goes two different ways. I was suspecting it is about some sort of security, since it is behaving differently for an auditor role - with permission to submit expenses, and for admin or approver role.
This is a part of a workflow. When an user with auditor role submits expense, that expense can be approved, but then it gets stuck in the workflow - with an error indicating that there is no ‘from’ currency to convert from. debugging shows where is the error, and what field is missing the currency code to lead to that error.
So those 2 lines in the original post is where currency is found for admin/ approver role, and not for user/auditor role.
If it helps, the table in question is ProjectAccountingDistribution, and the field is Currency. Values are assigned in InitFromSourceDocumentLineItem method.
It looks like there was a Policy in place that i was not aware of, where there is a constraint on a ProjInvoice table. I can see the context type set to RoleProperty, but the ContextString is empty. I cant find anything related to that policy in the Roles that are able to access the table .
If the ContextString is blank, does the policy apply to all roles, or none?
Is there a way to override the Policy rules through the code?
Thanks,