Re: grant the right to select only certain rows?

From: Fran Fabrizio <ffabrizio(at)mmrd(dot)com>
To: Jan Wieck <janwieck(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: grant the right to select only certain rows?
Date: 2002-01-25 18:37:29
Message-ID: 3C51A5E9.76AD9EC5@mmrd.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> But you could setup a second table teachers:
>
> name grade
> -------------------
> mary_smith 1
> tom_white 2
>
> and then use a view
>
> CREATE VIEW my_students AS SELECT S.name, S.grade_level
> FROM students S, teachers T
> WHERE T.name = CURRENT_USER AND T.grade = S.grade_level;
>
> Now the teachers don't need SELECT permissions on students,
> but only on my_students. Mary can only see Joe and Kim, and
> Tom can only see Lisa and Mike.

Ahh...this was the missing link in my head. A way to make one view
customize itself to serve all users.

Thank you!

-Fran

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arguile 2002-01-25 18:55:36 Re: grant the right to select only certain rows?
Previous Message Fran Fabrizio 2002-01-25 18:35:29 Re: grant the right to select only certain rows?