otmfaqForumsBlogsRegister
FAQMembers ListCalendarToday's PostsSearch


 Subscribe Blogs:RSS
 Subscribe Forums:RSS
OTMFAQ Home
OTMFAQ Blogs
OTMFAQ Forums
OTMFAQ Tutorials

OTM SIG
MavenWire


Database Administration Database installation, creation, administration and related topics.

Tags: , ,

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old August 23rd, 2008, 13:09
Junior Member
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 0
namitsinghi is on a distinguished road
Predicate to restrict data for corporation

Hi,

I have a requirement to restrict the data that user can view using Predicates. I cannot use Domain/Sub-domain to restrict the data view due to some business requirement.

I want to restrict the data that user can view to within a corporation using predicates. I have defined a VPD context variable 'CORPORATION_GID' for the corporation to which I wish to restrict the user and defined following predicate (for example) on OB_ORDER_BASE table:

Predicate:
EXISTS (SELECT 1 FROM ob_line obl WHERE obl.order_base_gid = OB_ORDER_BASE.order_base_gid and SOURCE_LOCATION_GID IN (SELECT LOCATION_GID FROM LOCATION_CORPORATION WHERE CORPORATION_GID = SYS_CONTEXT('gl_user_ctx','CORPORATION_GID')))

Test Query:
SELECT * from OB_ORDER_BASE
WHERE EXISTS
(SELECT 1 FROM ob_line obl
WHERE obl.order_base_gid = OB_ORDER_BASE.order_base_gid
and SOURCE_LOCATION_GID IN (SELECT LOCATION_GID FROM LOCATION_CORPORATION WHERE CORPORATION_GID = SYS_CONTEXT('gl_user_ctx','CORPORATION_GID')))

When running the above test query on sql developer, the data shown is only for that specified corporation. But when defininig the predicate and opening the order base page, I see all the order bases, immaterial of corporation. Can you please verify and let me know what is wrong with the above predicate and how can I restrict the search window to show only those order bases that belong to specific corporation.

I similarly would then define predicates for all the entities within OTM, Order base is just one example.

Thanks.
Namit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old August 25th, 2008, 04:20
Member
 
Join Date: Dec 2007
Posts: 66
Thanks: 5
Thanked 10 Times in 10 Posts
Groans: 1
Groaned at 1 Time in 1 Post
Rep Power: 2
james_foran is on a distinguished road
Re: Predicate to restrict data for corporation

Have a look at how the VPD is set up. there is another way to test the query...

1) Run the following PL/SQL
begin vpd.set_user('USER_GID");end;

2) Run the query
select * from ob_order_base.

3) Run the query
SELECT SYS_CONTEXT('gl_user_ctx','CORPORATION_GID') from dual

The results of 2 will allow you to quickly see what effect the VPD is having, as it is applied at the Database level.

The results of 3 should tell you if your VPD Context is set correctly.

If you are still having issues, I would advise that you get a DBA to run through the above also. They should be able to get right into the issue.
__________________
James Foran
Toll Solutions
http://www.tollgroup.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old August 25th, 2008, 21:20
Junior Member
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 0
namitsinghi is on a distinguished road
Re: Predicate to restrict data for corporation

Thanks James.

I realized the reason for issue. I had defined predicate for Read/Write access only, but not Read access. Thus, when selecting data on search page, data was not getting filtered. Added predicate for Read access also, and the above issue is resolved. I had initially thought that Read/Write internally covers Read also...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
VPD profiles using Corporation cool_brat SysAdmin and Management 2 August 29th, 2008 04:27



All times are GMT. The time now is 21:03.
Copyright © 2008, Open Book Solutions LLC. All rights reserved.

Sponsored by MavenWire - MavenWire.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37