Hello,
I have a problem with security policy. The requirement is: have a role, which will be assigned to the user. User with this role will see only sales order with status Invoiced and Customer account CU001.
I have created query, in ranges I have created new range with field CustAccount and in Value inserted CU001, and next range with field SalesStatus and Value 2 (which is based on the enum value)
Then I have created new Security policy. In policy I set the Context Type as RoleName, Operation AllOperations, Primary Table SalesTable, Query - name of the previously created query and Role name. Then I right-clicked on Constrained tables and created new Constrained Expression. In this epression, I have set Name as SalesTable, Constrained Yes and Value CustAccount=CU001 & SalesStatus=2.
Like this it works fine, when I assign this role to the user. BUT I would like to ask, please, if I followed the right steps? Is it possible to use insted of Constrained expression Constrained Table? I am not sure because I am working with only one table, and there is not one Constrained table and the second one Primary Table.
Also I do not understand, why I need to create a query that filters the data as I need and then I need to create a Constrained expression, where I set the filter again, in the Value (CustAccount=CU001 & SalesStatus=2). I have tried to create only the query, assign this query to the policy and the policy to the role, and NOT create any Constrained table or expression, BUT the filter did not applied to the data. Can someone explain me, please, the logic behind?
Many thanks.