Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invoker rights in Oracle

Status
Not open for further replies.

surabhi2004

Programmer
Jan 5, 2004
2
US
I am using Oracle 8i.
I have a package. I have some functions and procedures in this package. These functions use SELECT statements and return some value. But these procedures use DML statements and insert/update/delete some tables in the database.
I granted execute on this package to browser_rl (This is a role which has select access to tables/views etc).
Since this package has been given browser_rl, anybody who has browser_rl can execute DML procedure.

Package tst_pkg
procedures proc1, proc2, proc3
functions fnc1, fnc2, fnc3.

My requirement is anybody who has browser_rl should be able to access functions fnc1, fnc2, fnc3. But he/she should not have privilege to run procedures proc1, proc2, proc3 which have DML statements and update the database.

I tried using
CREATE OR REPLACE PACKAGE tst_pkg
AUTHID CURRENT_USER
AS
...
END tst_pkg

But this does not seem to work. By default, oracle uses AUTHID DEFINER.

Thanks for your help.
 
I suppose this is an issue of wrong design. My suggestion is to split your package and grant only querying part to common role.

Regards, Dima
 
AUTHID CURRENT_USER in the package specification worked fine. Any user logging in now is able to access the functions. But the schema which owns the packages only is able to run DML procedures as other uses do not have privilege to perform DML statements.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top