(I'm not sure whet version of ords I'm running, it came with Apex 4. I don't think the version is very important.)
I've previously sometimes used direct procedure calls using ords/apex listener, of the form /server/something/schema.procedure to fetch some data.
That call would have sys_context('userenv','session_user') set to APEX_PUBLIC_USER.
This value is used in a table policy (vpd/rls) to determine the output.
As far as I understand, setting up something similar using the ORDS package gives me a procedure call where sys_context('userenv','session_user') is the schema that created the service.
If this schema is the master schema my vpd is effectively disabled, as the policy makes an exception for the master.
I have also found that there is a variable :current_user that can be used in the service source, but this is NULL if unauthorized users are allowed (and they are for me).
The only solution (besides from changing my policies) seems to be to set up a new schema that just owns the ords services.
When the new schema calls the master schema procedures, the vpd will work again.
Any thoughts? Have I missed/misunderstood something?
In case it helps someone...
I already had another schema that Oracle Reports connects as to run our reports.
I set up the same services for this reports schema and then our vpd system works fine again.