has_table_privilege for a table in unprivileged schema causes anerror

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема has_table_privilege for a table in unprivileged schema causes anerror
Дата
Msg-id 20180817075100.bc99378255943d3c3951ad63@sraoss.co.jp
обсуждение исходный текст
Ответы Re: has_table_privilege for a table in unprivileged schema causes an error
Список pgsql-hackers
Hi,

I found that has_table_privilege returns an error when a table is specified
by schema-qualified name and the user doen't have privilege for its schema.

 postgres=> select has_table_privilege('myschema.tbl','select');
 ERROR:  permission denied for schema myschema

I think that this function should return false because the user doesn't have
the privilege on this table eventually.  It is more useful for users because
it is not needed to parse the schema-qualified table name and check the
privilege on the schema in advance.

Attached is a patch to modify the function like that. This is WIP patch, so
only has_table_previlege is modified and other familiy functions are left as
they are. Also, there is no additional test yet.

One consern on this patch is that modifying the function can break the 
back-compatibility, so it might be better to add a new parameter to
control the behavior of the function. 

Any comments would be appriciated.

Regards,
-- 
Yugo Nagata <nagata@sraoss.co.jp>

Вложения

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

Предыдущее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: docs: note ownership requirement for refreshing materializedviews
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Incorrect error handling for two-phase state files resulting indata loss