pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
security via views
3+ messages / 3 participants
[nested] [flat]

* security via views
@ 2005-04-27 15:52 Enrico Weigelt <weigelt@metux.de>
  2005-04-27 16:01 ` Re: security via views Peter Dockweiler <pdo@wikon.de>
  2005-04-27 17:27 ` Re: security via views Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: Enrico Weigelt @ 2005-04-27 15:52 UTC (permalink / raw)
  To: pgsql-admin


Hi folks,

we've got a larger project with several subsystems, which should
run in their own security context / users. 

Most of the database access works over views and functions. 
For functions its possible to run them with separate privileges
than the calling user. But is this also possible with views ?
I've noticed that for views also GRANT is necessary (AFAIK a
view is nothing else than a table with appropriate RULEs). 
Does it work to grant some user access to his own view, but
not to the tables where the view works on ?


thx
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: security via views
  2005-04-27 15:52 security via views Enrico Weigelt <weigelt@metux.de>
@ 2005-04-27 16:01 ` Peter Dockweiler <pdo@wikon.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Peter Dockweiler @ 2005-04-27 16:01 UTC (permalink / raw)
  To: pgsql-admin

Hello,

yes this works. Just drop the rights on the table and grand the rights on the 
view.

Peter

Am Mittwoch, 27. April 2005 17:52 schrieb Enrico Weigelt:
> Hi folks,
>
> we've got a larger project with several subsystems, which should
> run in their own security context / users.
>
> Most of the database access works over views and functions.
> For functions its possible to run them with separate privileges
> than the calling user. But is this also possible with views ?
> I've noticed that for views also GRANT is necessary (AFAIK a
> view is nothing else than a table with appropriate RULEs).
> Does it work to grant some user access to his own view, but
> not to the tables where the view works on ?
>
>
> thx



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: security via views
  2005-04-27 15:52 security via views Enrico Weigelt <weigelt@metux.de>
@ 2005-04-27 17:27 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2005-04-27 17:27 UTC (permalink / raw)
  To: weigelt@metux.de; +Cc: pgsql-admin

Enrico Weigelt <weigelt@metux.de> writes:
> Most of the database access works over views and functions. 
> For functions its possible to run them with separate privileges
> than the calling user. But is this also possible with views ?
> I've noticed that for views also GRANT is necessary (AFAIK a
> view is nothing else than a table with appropriate RULEs). 

You have noticed incorrectly.  A view's references to other tables
are privilege-checked with respect to the owner of the view.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-04-27 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-27 15:52 security via views Enrico Weigelt <weigelt@metux.de>
2005-04-27 16:01 ` Peter Dockweiler <pdo@wikon.de>
2005-04-27 17:27 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox