Question: I
need to understand the authid and invoker rights, and how the
authid current_user related to invoker rights. What does
invoker rights mean?.
Answer: The authid current_user
is used when you want a piece of code (PL/SQL) to execute with the
privileges of the invoker (the current user), and NOT the user ID that created the
procedure. This is termed a "invoker rights", the opposite of
"definer rights".
To understand the authid current_user, consider this type
definition where the invoker gets the rights to the :
CREATE TYPE address_t
AUTHID CURRENT_USER
AS OBJECT (
address_line1 varchar2(80),
street_name
varchar2(30),
street_number
number,
city varchar2(30),
state_or_province varchar2(2),
country_code varchar2(20));
See
this example of authid invoker rights to understand how the
invoker rights
syntax causes invoker rights, which, in turn, changes the behavior
of the PL/SQL code away from the definer rights as we would find in
a grant execute or definer rights.
Below is a a query that shows all procedures
that have authid = 'DEFINER' (definer rights) or authid =
'CURRENT_USER' (invoker rights).
select
object_name,
procedure_name,
authid
from
dba_procedures;
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|