current_user inside SECURITY DEFINER function?

Поиск
Список
Период
Сортировка
От Richard Hayward
Тема current_user inside SECURITY DEFINER function?
Дата
Msg-id ctllc1lqcht4a2bcn4j1vo35r0oqe28vul@4ax.com
обсуждение исходный текст
Ответы Re: current_user inside SECURITY DEFINER function?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: current_user inside SECURITY DEFINER function?  (Stephen Frost <sfrost@snowman.net>)
Re: current_user inside SECURITY DEFINER function?  (Adam Witney <awitney@sgul.ac.uk>)
Список pgsql-general
Is there any way to get the name of the current user inside a PL/pgSQL
function that is defined with security definer?

current_user gives the name of the user who created the function.

The reason I want this is that I intend to use functions to maintain
security, like this:

userA has only select permission on myTable.

The only way userA can insert to myTable is by providing parameters
for and executing myFunction.

myFunction was created by user postgres who does have insert
permission on myTable. However the code inside myFunction needs to do
different things, depending on who called it.

Is there any way of getting the user?

regards
Richard


В списке pgsql-general по дате отправления:

Предыдущее
От: Clark Allan
Дата:
Сообщение: Re: PostgreSQL sequence within function
Следующее
От: Clark Allan
Дата:
Сообщение: Re: PostgreSQL sequence within function