Re: How to limit access only to certain records?

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: How to limit access only to certain records?
Дата
Msg-id 20120622123251.GA30662@tux
обсуждение исходный текст
Ответ на How to limit access only to certain records?  (Andreas <maps.on@gmx.net>)
Список pgsql-sql
Andreas <maps.on@gmx.net> wrote:

> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers  
> only acording to a flag?

Yea, it's possible.

Write functions to access to the table (for select, for insert and so
on) as superuser, with secutity definer, revoke all rights from the
user.

Users can only access to the table with the functions, within this
functions check if the current_user has rights for the record.

There are some examples how to do that, please use google ;-)



Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


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

Предыдущее
От: Andreas
Дата:
Сообщение: How to limit access only to certain records?
Следующее
От: Jov
Дата:
Сообщение: Re: How to limit access only to certain records?