Re: Need help revoking access WHERE state = 'deleted'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Stosberg <mark(at)summersault(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Need help revoking access WHERE state = 'deleted'
Date: 2013-02-28 19:08:12
Message-ID: 9963.1362078492@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mark Stosberg <mark(at)summersault(dot)com> writes:
> # Explicitly grant access to the view.
> db=> grant select on entities_not_deleted to myuser;
> GRANT

> # Try again to use the view. Still fails
> db=> SELECT 1 FROM entities_not_deleted WHERE some_col = 'y';
> ERROR: permission denied for relation entities

What's failing is that the *owner of the view* needs, and hasn't got,
select access on the entities table. This is a separate check from
whether the current user has permission to select from the view.
Without such a check, views would be a security hole.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Stosberg 2013-02-28 19:29:15 Re: Need help revoking access WHERE state = 'deleted'
Previous Message Mark Stosberg 2013-02-28 18:35:15 Re: Need help revoking access WHERE state = 'deleted'