From: | tolik(at)icomm(dot)ru (Anatoly K(dot) Lasareff) |
---|---|
To: | Paulo da Silva <pdasilva(at)esoterica(dot)pt> |
Cc: | pgsql-general(at)postgreSQL(dot)org |
Subject: | Re: [GENERAL] Conditioned access to a database |
Date: | 1999-02-12 09:15:44 |
Message-ID: | 87emnw2da7.fsf@tolikus.hq.aaanet.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
>>>>> "PdS" == Paulo da Silva <pdasilva(at)esoterica(dot)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(at)icomm(dot)ru
Senior programmer
From | Date | Subject | |
---|---|---|---|
Next Message | MAILER-DAEMON | 1999-02-12 09:40:58 | Undeliverable Message |
Previous Message | Blashko Alexander | 1999-02-12 08:27:55 | Re: [GENERAL] Problem with table,field names. |