Re: [GENERAL] Conditioned access to a database

Поиск
Список
Период
Сортировка
От tolik@icomm.ru (Anatoly K. Lasareff)
Тема Re: [GENERAL] Conditioned access to a database
Дата
Msg-id 87emnw2da7.fsf@tolikus.hq.aaanet.ru
обсуждение исходный текст
Ответ на Conditioned access to a database  (Paulo da Silva <pdasilva@esoterica.pt>)
Список pgsql-general
>>>>> "PdS" == Paulo da Silva <pdasilva@esoterica.pt> writes:

 PdS> Hello,
 PdS> I'm evaluating sql/postgresql for the following purpose:
 PdS> I need to have a database with lots of "records".
 PdS> I need to allow groups of users to access sets of
 PdS> those records grouped by the contents of one field.
 PdS> For example, the group A can only access records that
 PdS> have the dptm field = "A". Is this possible?

 PdS> If the subject is not simple, pls just tell me
 PdS> which doc to read.

Suppose you have table:

create table a (
  tag int,
  info text
);

and you want controll user's depend on the 'tag' field value. I think
you can do following:

create view v1 as select info from a where tag = 1;
create view v2 as select info from a where tag = 2;
create view v3 as select info from a where tag = 3;

revoke all on a from public;

grant select on v1 to user1, user2...;
grant select on v2 to group gr1, ...;
. . .


--
Anatoly K. Lasareff              Email:       tolik@icomm.ru
Senior programmer

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

Предыдущее
От: Blashko Alexander
Дата:
Сообщение: Re: [GENERAL] Problem with table,field names.
Следующее
От:
Дата:
Сообщение: Undeliverable Message