Fine Grain Access Control [message #210097] |
Tue, 19 December 2006 06:32 |
tanmay
Messages: 1 Registered: December 2006
|
Junior Member |
|
|
Hi
I need to implement fine grain control in my database keeping connection pooling on. For that i declared the application context globally. then i created required policy and procedures to implement it. The code of the procedure is given below.
CREATE OR REPLACE package body my_pkg
as
g_session_id number;
procedure set_session_id(p_session_id in number)
is
begin
g_session_id := p_session_id;
dbms_session.set_identifier( p_session_id );
end;
procedure set_ctx(user_name_in in varchar2)
is
branch_id NUMBER;
begin
select branch_id into branch_id from users where user_name=user_name_in;
dbms_session.set_context( 'App_Ctx','mybranch',branch_id,USER,g_session_id);
--dbms_session.set_context( 'App_Ctx','mybranch',branch_id);
--dbms_output.put_line('g_session_id-->'||g_session_id);
--dbms_output.put_line('branch id-->'||branch_id);
end;
procedure close_session( p_session_id in number )
is
begin
dbms_session.set_identifier( p_session_id );
dbms_session.clear_identifier;
end;
end;
If i do not set the identifier (which i need to do in case of global access and connection pooling) and set the context only then the VPD is working fine. But when i try to set the identifier against a user keeping the context global, the process fails. Can any one help?
|
|
|