Oracle was using, is using USER_ROLE_PRIVS in the designed fashion -- in the expected fashion.
a stored procedure runs with the privs of the DEFINER (it is called definers rights) by default.
tell you what -- you give me a
a) simple
b) CONCISE
c) yet 100% complete test case (in the fashion I always give you guys)
that anyone on the planet could run
that clearly demonstrates only exactly what you think the issue to be
I'll be glad to take a look at it. Your script for example would have 2 create user commands, a connect to user 1, creat tables, insert into, create procedure. it would then demonstrate what you get (and state what you think you should get) log in as other user and so on.
You know, exactly what I would have to do in order to say anything, demonstrate anything, prove anything
The page you used to get here in the first place, to ask the question said things like:
DONT give a describe of a table
DO give me a create table
DONT give me a "select * from table"
DO give me insert intos
So, give us a clear example -- that anyone could run -- that demonstrates what you believe to be "wrong" or "unintuitive" behavior -- and we can comment maybe.
<b>this is how I expecte user_role_privs to work:</b>
ops$tkyte@ORA9IR2> set termout on
ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> create or replace procedure p
2 as
3 begin
4 for x in ( select * from user_role_privs )
5 loop
6 dbms_output.put_line( x.username || ', ' || x.granted_role );
7 end loop;
8 end;
9 /
Procedure created.
ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> grant execute on p to public;
Grant succeeded.
ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> exec p
OPS$TKYTE, CONNECT
OPS$TKYTE, DBA
PUBLIC, PLUSTRACE
PL/SQL procedure successfully completed.
ops$tkyte@ORA9IR2> @connect scott/tiger
ops$tkyte@ORA9IR2> set termout off
scott@ORA9IR2> set termout on
scott@ORA9IR2> exec ops$tkyte.p
OPS$TKYTE, CONNECT
OPS$TKYTE, DBA
PUBLIC, PLUSTRACE
PL/SQL procedure successfully completed.
<b>ops$tkyte, regardless of who invoked it</b>