Need help revoking access WHERE state = 'deleted'

Поиск
Список
Период
Сортировка
От Mark Stosberg
Тема Need help revoking access WHERE state = 'deleted'
Дата
Msg-id kgo14h$vm3$1@ger.gmane.org
обсуждение исходный текст
Ответы Re: Need help revoking access WHERE state = 'deleted'  (Ben Morrow <ben@morrow.me.uk>)
Список pgsql-sql
We are working on a project to start storing some data as "soft deleted"
(WHERE state = 'deleted') instead of hard-deleting it.

To make sure that we never accidentally expose the deleted rows through
the application, I had the idea to use a view and permissions for this
purpose.

I thought I could revoke SELECT access to the "entities" table, but then
grant SELECT access to a view:
 CREATE VIEW entities_not_deleted AS SELECT * FROM entities WHERE state
!= 'deleted';

We could then find/replace in the code to replace references to the
"entities" table with the "entities_not_deleted" table

However, this isn't working, I "permission denied" when trying to use
the view. (as the same user that has had their SELECT access removed to
the underlying table.)

We are not stuck on this design. What's a recommended way to solve this
problem?
  Mark




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

Предыдущее
От: Marko Rihtar
Дата:
Сообщение: Concatenating bytea types...
Следующее
От: Ben Morrow
Дата:
Сообщение: Re: Need help revoking access WHERE state = 'deleted'