How can I let the user perform other user functions?

I want to give the user privileges to call a function of another user function.

I write this: GRANT EXECUTE ANY FUNCTION TO user;

but that will not work.

the user needs to call this:

 call XXX.YYY.AlterAllInvalidObjects(NULL,'PACKAGE BODY'); 

but how can I provide a grant?

NOTE. I do not want to use: GRANT EXECUTE ON FUNCTION AlterAllInvalidObjects TO user; I need a general solution, not a specific function name.

+4
source share
2 answers
 GRANT EXECUTE ANY PROCEDURE TO user; 

http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9013.htm#i2077938

will manage both functions and procedures. You cannot provide this method only to functions ...

EDIT

another way (but you have to run it every time another user creates a new function to receive all grants):

Run

 select 'GRANT EXECUTE ON '||owner||'.'||object_name||' TO user;' from all_objects where owner = 'xxx' and object_type='FUNCTION'; 

and copy-paste - execute the result ...

or use an SP doing the same (cursor to query and execute an immediate loop)

+5
source

To be honest, it seems you are asking about synonyms, not about grants, because grants do not help you call AlterAllInvalidObjects without mentioning the scheme. Please pay attention to http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7001.htm

0
source

Source: https://habr.com/ru/post/1433966/


All Articles