Re: grant the right to select only certain rows?

Поиск
Список
Период
Сортировка
От Fran Fabrizio
Тема Re: grant the right to select only certain rows?
Дата
Msg-id 3C51A5E9.76AD9EC5@mmrd.com
обсуждение исходный текст
Ответ на Re: grant the right to select only certain rows?  (Jan Wieck <janwieck@yahoo.com>)
Список 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



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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: grant the right to select only certain rows?
Следующее
От: Fran Fabrizio
Дата:
Сообщение: Re: grant the right to select only certain rows?