security on line by line basis

Started by Lorenzo Huertaover 27 years ago4 messagesgeneral
Jump to latest
#1Lorenzo Huerta
lorhuerta@yahoo.com

hey folks

is there a way to set postgres 6.3 up to do security on a record by
record basis?
See what i am doing is createing a database that needs several
levels of security
admin - total access to databasee
sub-admin - total access to database except for the first 2 and
last 2 entries in the database
group-admin - access to only a piece of the database based on
criteria

can i create a rule and have grant and revoke privs based on that
rule?

-lorenzo
email: lorenzo@nmsu.edu
lorhuerta@yahoo.com

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

#2Maarten Boekhold
maartenb@dutepp0.et.tudelft.nl
In reply to: Lorenzo Huerta (#1)
Re: [ADMIN] security on line by line basis

On Fri, 17 Jul 1998, Lorenzo Huerta wrote:

hey folks

is there a way to set postgres 6.3 up to do security on a record by
record basis?
See what i am doing is createing a database that needs several
levels of security
admin - total access to databasee
sub-admin - total access to database except for the first 2 and
last 2 entries in the database
group-admin - access to only a piece of the database based on
criteria

can i create a rule and have grant and revoke privs based on that
rule?

You can create 3 tables, and then make 2 views: one for the admin, one
for the sub-admin, using union's....

Maarten

_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems |
| Department of Electrical Engineering |
| Computer Architecture and Digital Technique section |
| M.Boekhold@et.tudelft.nl |
-----------------------------------------------------------------------------

#3Lorenzo Huerta
lorhuerta@yahoo.com
In reply to: Maarten Boekhold (#2)
Re: [ADMIN] security on line by line basis

hmm is there another way of doing it as that sounds a little costly,
as so far database is at 2MB of data and
increases daily

-lorenzo

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

#4Maarten Boekhold
maartenb@dutepp0.et.tudelft.nl
In reply to: Lorenzo Huerta (#3)
Re: [ADMIN] security on line by line basis

On Sun, 19 Jul 1998, Lorenzo Huerta wrote:

hmm is there another way of doing it as that sounds a little costly,
as so far database is at 2MB of data and
increases daily

Dunno, as far as I know unions are pretyy efficient. An the other hand,
you could ofcourse do the following:

Add a column to the table which describes additional priviledges.
Write a trigger that uses that column and the current user-name to
determine whether a row should be returned.

Ah, just remembered, that won't work, cos you cannot define a trigger on
a select. Damned....

I don't know why Vadim didn't implement it, maybe it's just too dificult
to do, but I think there are certainly uses for such a trigger. Something
for 6.4???

Maarten

_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems |
| Department of Electrical Engineering |
| Computer Architecture and Digital Technique section |
| M.Boekhold@et.tudelft.nl |
-----------------------------------------------------------------------------