has_schema_privilege function

Поиск
Список
Период
Сортировка
От Jignesh Shah
Тема has_schema_privilege function
Дата
Msg-id c11950271003090228g7c9d05bege0c51d36d9833dc0@mail.gmail.com
обсуждение исходный текст
Ответы Re: has_schema_privilege function  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
Hi, I have created below function. I am checking return value of has_schema_privilege by using flag="f". I think this is not strong way to make a check because if in future "f" becomes "false" my stored procedure will work improper.
 
Could you tell me is there any other robust way to make sure that user1 doesn't have CREATE permissions on mydb schema?
 
CREATE OR REPLACE FUNCTION schema_perm_test()
  RETURNS void AS
$BODY$
    $rv = spi_exec_query("SELECT has_schema_privilege('user1', 'mydb', 'CREATE') AS flag;");
    if(lc($rv->{rows}->[0]->{flag}) eq "f") {
         # Do tasks
    }
$BODY$
  LANGUAGE 'plperl' VOLATILE SECURITY DEFINER
 
Thanks.

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

Предыдущее
От: venkatrao.b@tcs.com
Дата:
Сообщение: Can we overload = operator to word numeric = text
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Can we overload = operator to word numeric = text