Re: Inconsistent permission enforcement for schemas

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marcin Barczyński <mba(dot)ogolny(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Inconsistent permission enforcement for schemas
Date: 2022-08-01 16:49:51
Message-ID: 1846618.1659372591@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?UTF-8?Q?Marcin_Barczy=C5=84ski?= <mba(dot)ogolny(at)gmail(dot)com> writes:
> Why can a user access a table from a forbidden schema if the table is
> explicitly specified in the definition of a view in an allowed schema? And
> not if the table is accessed by a function used in the view.

(1) Whether a view can access a table is determined by the ownership of
the view, not of the user using the view.

(2) It might be nice if the view's permissions were inherited by functions
called by the view, but we've not made that happen. You might be able to
approximate it by marking such functions SECURITY DEFINER; although that
makes the function's permissions those of the function's owner not the
view's owner.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2022-08-02 03:20:55 RE: Support logical replication of DDLs
Previous Message Marcin Barczyński 2022-08-01 15:48:34 Inconsistent permission enforcement for schemas