View Single Post
  #2 (permalink)  
Old September 19th, 2008, 03:55
james_foran james_foran is offline
Member
 
Join Date: Dec 2007
Posts: 72
Groans: 1
Groaned at 1 Time in 1 Post
Thanks: 5
Thanked 12 Times in 12 Posts
Rep Power: 2
james_foran is on a distinguished road
Re: What exactly are "SYS_CONTEXT" and "gl_user_ctx" in a VPD predicate?

Hi,

This is used to substitute a condition within the EXTERNAL_PREDICATE, with a VPD Context that is linked to the user.

Within your External Predciate, you may include the following:

where corporation_xid = SYS_CONTEXT('gl_user_ctx','CORPORATION_XID')


Within the VPD_CONTEXT/VPD_CONTEXT_VARIABLE table, the CONTEXT_VAR_NAME will contain the CORPORATION_XID, and the CONTEXT_VAR_VALUE contains the "TEST_CORPORATION".

For users that are linked to the VPD_CONTEXT, via their User Role, External Predicate will be executed as follows:

where corporation_xid = 'TEST_CORPORATION'

If there is no VPD Context linked to a user, all records are returned.

Hope this helps.

Regards,

James
__________________
James Foran
Toll Solutions
http://www.tollgroup.com
Reply With Quote